11175
(-- --)
July 30, 2008, 5:45pm
1
view:
<%= link_to_remote "Remove", :url => { :controller => "auth_user",
:action => :remove_req }, :id => "post.requirement_id" %></td>
controller:
def remove_req
redirect_to :action => :index
end
When I click on the link, it doesn't redirect. What's the problem?
Thanks
view:
<%= link_to_remote "Remove", :url => { :controller => "auth_user",
:action => :remove_req }, :id => "post.requirement_id" %></td>
controller:
def remove_req
redirect_to :action => :index
end
When I click on the link, it doesn't redirect. What's the problem?
You probably want link_to not link_to_remote. link_to_remote does an ajax call
link_to: Peak Obsession
link_to_remote:
Peak Obsession
11175
(-- --)
July 30, 2008, 6:24pm
3
Justin To wrote:
view:
<%= link_to_remote "Remove", :url => { :controller => "auth_user",
:action => :remove_req }, :id => "post.requirement_id" %></td>
controller:
def remove_req
redirect_to :action => :index
end
When I click on the link, it doesn't redirect. What's the problem?
Thanks
An Ajax request cannot redirect the page... at least not this way. I
don't think you want link_to_remote in this case. Try link_to. Note: you
want to be careful making links (HTTP GETs) do destructive things like
deleting data.