Forum: Ruby on Rails in_place_edit_field

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Shandy N. (Guest)
on 2007-07-06 23:42
I have this tables in my database: "user" with such fields as "first",
"last", for the first and last name. Now, I want to make it so after
these values are submitted to the database the user can still edit their
personal info in place with the in_place_editor_field helper. The code
is as follows:

<%= in_place_editor_field 'user','first',{}, :cols=>30%>

I cannot, however, get this helper to hit the database and resubmitt the
user data. It doesn't make sense that these helpers would be in a form,
so how do you get this helper to write back to a database?
Andy K. (Guest)
on 2007-07-07 01:19
(Received via mailing list)
Shandy N. schrieb:
> so how do you get this helper to write back to a database?
>

not entirely understanding your issue, but it sounds like your
controller method is the problem.

perhaps read this blog post
"http://rubythis.blogspot.com/2006/11/using-rails-i...

/ak
Shandy N. (Guest)
on 2007-07-07 01:19
Shandy N. wrote:
> I have this tables in my database: "user" with such fields as "first",
> "last", for the first and last name. Now, I want to make it so after
> these values are submitted to the database the user can still edit their
> personal info in place with the in_place_editor_field helper. The code
> is as follows:
>
> <%= in_place_editor_field 'user','first',{}, :cols=>30%>
>
> I cannot, however, get this helper to hit the database and resubmitt the
> user data. It doesn't make sense that these helpers would be in a form,
> so how do you get this helper to write back to a database?

I got it, in your controller you have to say:

in_place_edit_for :user, :first
This topic is locked and can not be replied to.