Okay, am going nuts trying to get this to work. I want to pass information I need to the new action and it ain’t working. I am in a view and using link_to with a path to create a new record:
<%= link_to "New", new_libation_path(:xid=> 123) %>
My routes table has: resources :libations
And in the libation_controller I have my new action…
def new
puts params[:xid] #This is nil!
...
What am I doing wrong? Maybe I should google how to use params in rails..
This looks right. Is the query string in the URL showing up as it should? Check on your rails console that
app.new_libation_path(:xid => 123)is returning the correct URL, and that this URL is showing up in your HTML markup:(from an app I had handy)