I have popup which is opened using:
<%= link_to user.username, "/users/"+user.id.to_s+"/edit", :method => :post, :target=> "_blank" %>
edit.html.erb file is:
<div id="dvUserMgmt" class="popup">
<%= form_for(:user, :url => { :controller => 'users', :action => 'update'}) do |f| %>
<table>
<tr>
<td class="labelfield">*Name</td>
<td class="textfield">
<input type="text" name="tb_realname" value=<%= @realname %> />
</td>
</tr>
<tr>
<td class="buttons" colspan="3">
<%= submit_tag 'Update', :url => { :controller => 'users', :action => 'update'}, :class => 'popup_closebox' %>
<%= tag :input, :type => 'button', :value => 'Cancel', :class => 'popup_closebox' %>
</td>
</tr>
</table>
<% end %>
</div>
Upon clicking update button, the action update is not getting executed.
Can anyone point where is the issue?
Lots of code is not written the Rails way, let’s correct it and see if it changes your result.
1) correct your line, but explain wh you have a post method for an edit?
2) Rails knows your entry already exists, I guess
@useris defined3) use the form helpers:
4) Provide your params to help debugging.