This is probably simple, I’m still coming to terms with rails syntax. What is the right syntax to pass the address_id in the url for form_for to a modified route?
This is the form – note the “address_id parameter”
<div class="one_fourth floatcenter">
<%= form_for address, :url => edit_address_path(:id => address.id), :method => :get do |f| %>
<%= content_tag(:button, :class => 'btn btn-inverse') do %> Edit Address
<% end %>
<% end %>
</div>
And this is the route I’ve configured:
get "edit_address/:id" => "member/addresses#edit"
Id is not being passed to the controller for some reason…
form_for addressshould be enough if address is a persisted object, but if it’s not enough, thenform_for address, url: edit_address_path(address)is what you want.