I got a round about solution for that, I created a rhtml page in the name of action, and added the FORM with method=post, and generated the html, at the end of the form, I used the script to submit the form, this works very quick (though I have added a Loading... icon in the div to avoid seeing the blank page just in case).
File: app/controllers/my_redirect_controler.rb
-
...
-
def redirect_post
-
end
-
...
-
Inside app/views/my_redirect/redirect_post.rhtml
-
<html>
-
<body>
-
<form method=post action="http://some_site:8080/login.xhtml" id='my_form'>
-
<input type="hidden" id="userName" name="userName" value="login_id" >
-
<input type="hidden" id="password" name="password" value="some_password" >
-
</form>
-
<script>
-
document.getElementById("my_form").submit()
-
</script>
-
</body>
-
</html>
-
So, now from the index page if I have a link which links to the action->controller
-
<%= link_to( image_tag("Redirect.gif"), {:controller=>'my_redirect', :action => "redirect_post"})%>
-
This will solve me the problem I was facing.
Cheers..