how does rails know if it should submit a form to update or create? the
form is rendered by either new or edit so on submission how does rails
know
which action originally rendered the form?
On Fri, Dec 25, 2015, at 16:16, fugee ohu wrote:
how does rails know if it should submit a form to update or create? the
form is rendered by either new or edit so on submission how does rails
know
which action originally rendered the form?
by checking the value returned by object.persisted?
.
they’re the same, <%= render ‘form’ %> is all they contain other than
links
and either
New model
orEditing model
On 25 December 2015 at 07:16, fugee ohu [email protected] wrote:
how does rails know if it should submit a form to update or create? the form
is rendered by either new or edit so on submission how does rails know which
action originally rendered the form?
Have a look at the html for the edit and new pages and I think you
will see a difference. Look at the form tag in particular.
Colin
On 26 Dec 2015 22:35, “fugee ohu” [email protected] wrote:
they’re the same, <%= render ‘form’ %> is all they contain other than
links and eitherNew model
orEditing model
I said to look at the HTML not your source code. The form tag is the
HTML
generated by the form_for code.
Also please don’t top post, as I have asked before. Thanks.
Colin
On Friday, December 25, 2015 at 4:14:36 AM UTC-5, Colin L. wrote:
On 25 December 2015 at 07:16, fugee ohu [email protected] wrote:
how does rails know if it should submit a form to update or create?
the form
is rendered by either new or edit so on submission how does rails know
which
action originally rendered the form?Have a look at the html for the edit and new pages and I think you
will see a difference. Look at the form tag in particular.Colin
–
You received this message because you are subscribed to the Google G.
“Ruby on Rails: Talk” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/rubyonrails-talk/791ad873-6fde-465e-9d91-c945d4c911d4%40googlegroups.com
.