Ruby on Rails Monday, March 9, 2020

In my :tour show view I put a form for :press_release and so when the form's submitted there's no prepending of press_release: { to the params hash The form doesn't have any inputs rather field values are passed in parentheses to the route I tried to prepend by adding press_release: { as shown below but it causes a syntax error
    <%= form_with model: @press_release, create_user_tour_press_release_path(press_release: {tour.id: @tour.id, artist_id: @artist.id, poster_type: 'User'}) do |f| %>
I originally had it like this:
    <%= form_with model: @press_release, create_user_tour_press_release_path(tour.id: @tour.id, artist_id: @artist.id, poster_type: 'User') do |f| %>
but that had the problem of no prepended press_release to the params

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/32be9300-abbf-47b6-9743-ae0e7edb1fde%40googlegroups.com.

No comments:

Post a Comment