I have a many_to_many relation with photos and sponsors.
When creating a new Photo, in the new.html.erb view, I would like to add the sponsor attributes (which belong to a different model, but are relationed with photo), but I don't know how to.
I want to add :sponsor_name, :sponsor_web inputs in the Photo creation view, so I can add info about the sponsors the photo has when I create a new photo
I tried creating 2 simple_forms in the same view, one with the photo table attributes, and the other with the sponsor attributes, but didn't work.
Mi view (new.html.erb)
<%= simple_form_for [current_user, @photo] do |f| %>
<%= f.button :submit, "Subir Spot"%>
<% end %>
My Photos#new Controller
def new
@photo = Photo.new
@sponsor = @photo.sponsors
end
nested_attributes.