title: Rails redirect_to post method?
body: <pre><code>    redirect_to :controller=&gt;'groups',:action=&gt;'invite'
  </code></pre>
  
  <p>but I got error because redirect_to send GET method I want to change this method to 'POST' there is no :method option in redirect_to what will I do ? Can I do this without redirect_to.</p>
  
  <p>Edit:</p>
  
  <p>I have this in groups/invite.html.erb</p>
  
  <pre><code>&lt;%= link_to "Send invite", group_members_path(:group_member=&gt;{:user_id=&gt;friendship.friend.id,  :group_id=&gt;@group.id,:sender_id=&gt;current_user.id,:status=&gt;"requested"}), :method =&gt; :post %&gt;
  </code></pre>
  
  <p>This link call create action in group_members controller,and after create action performed I want to show groups/invite.html.erb with group_id(I mean after click 'send invite' group_members will be created and then the current page will be shown) like this:</p>
  
  <pre><code>redirect_to :controller=&gt;'groups',:action=&gt;'invite',:group_id=&gt;@group_member.group_id
  </code></pre>
  
  <p>After redirect_to request this with GET method, it calls show action in group and take invite as id and give this error</p>
  
  <pre><code>Couldn't find Group with ID=invite
  </code></pre>
  
  <p>My invite action in group</p>
  
  <pre><code>    def invite
  @friendships = current_user.friendships.find(:all,:conditions=&gt;"status='accepted'")
  @requested_friendships=current_user.requested_friendships.find(:all,:conditions=&gt;"status='accepted'")
  @group=Group.find(params[:group_id])
   end
  </code></pre>
  
  <p>The solution is I have to redirect this with POST method but I couldn't find a way.</p>
  
  <p>Ugly solution: I solved this problem which I don't prefer. I still wait if you have solution in fair way.</p>
  
  <p>My solution is add route for invite  to get rid of  'Couldn't find Group with ID=invite' error.</p>
  
  <p>in routes.rb</p>
  
  <pre><code>   map.connect "/invite",:controller=&gt;'groups',:action=&gt;'invite'
  </code></pre>
  
  <p>in create action</p>
  
  <pre><code>   redirect_to "/invite?group_id=#{@group_member.group_id}"
  </code></pre>
  
  <p>I call this solution in may language 'amele yontemi' in english 'manual worker method' (I think).</p>