<% form_for(@adv, :url => {:action=>'create'}) do |f| %>

I’m following an example in the “Head First Rails” book, but just
changed @ad to @adv.

Regarding the following in “new.html.erb”:

<% form_for(@adv, :url => {:action=>‘create’}) do |f| %>

I just want to confirm if I’m correct on that.

  • @adv: is the object to which the form is bound to.
  • :url => {:action=>‘create’}: this is the action that we will be
    redirected to when clicking the f.submit button.

Is that correct that way?

Thanks.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs