i was wondering whether it is possible to use partials along with
form_for
and form_field. following code is not working. is there some error or
this
case is impossible…??
i was wondering whether it is possible to use partials along with
form_for and form_field. following code is not working. is there
some error or this case is impossible…??
You need to pass the form builder object to the partial (eg via
locals). You are passing it, but then you’re not using it, so if you
change your partial to use partner.error_messages etc… it should work.
Alternatively you could just do
<%= render :partial => f%>
Because f is a FormBuilder this will render the partial _form and will
set the local variable form to be the form builder (so you’ll need to
use form.error_messages etc…).
use form.error_messages etc…).
thanks for the help Frederick. i got it.
but how do i get the value entered in a partial form…?
like i have an ‘address’ partial that i am rendering in a ‘user’ view.
then how do i retrieve the values entered in partial in the ‘user’
controller?
specifically which ‘param’ symbol?
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.