Forum: Ruby on Rails In place editing for a "group of fields"

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.
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-02 01:57
(Received via mailing list)
I remember seeing such a technique in a blog/article/book but am
unable to find it.

It essentially used a hidden div which contained the form which was
visible only during editing.

any pointers ?
Cdb765f639f8b2def103edd44d9b110f?d=identicon&s=25 Mike Riley (wdperson)
on 2007-06-02 05:26
idealguru@gmail.com wrote:
> I remember seeing such a technique in a blog/article/book but am
> unable to find it.
>
> It essentially used a hidden div which contained the form which was
> visible only during editing.
>
> any pointers ?

Are you looking for something like this?:
http://24ways.org/2005/edit-in-place-with-ajax

I found script.aculo.us has this built in (which is in Ruby on Rails):
http://wiki.script.aculo.us/scriptaculous/show/Aja...

I also found this for prototype (also built in to Ruby on Rails):
http://joseph.randomnetworks.com/archives/2006/04/...

Hopefully, one of these will help.
Mike
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-02 17:09
(Received via mailing list)
Thanks Mike ... all of those resources talk about in-place editing for
just one field at a time.

What I am looking for is a dynamic form that follows the same
principle but for a group of fields at a time. So instead of having to
save each individual field, the user can edit multiple fields and hit
save just once.
Cdb765f639f8b2def103edd44d9b110f?d=identicon&s=25 Mike Riley (wdperson)
on 2007-06-02 21:24
idealguru@gmail.com wrote:
> Thanks Mike ... all of those resources talk about in-place editing for
> just one field at a time.
>
> What I am looking for is a dynamic form that follows the same
> principle but for a group of fields at a time. So instead of having to
> save each individual field, the user can edit multiple fields and hit
> save just once.

Unfortunately, I don't see anything that has that.  I did find someone
who asked about the same functionality in November 2006, but the reply
was that the edit in place script would have to be re-worked.  Sorry I
couldn't help.

Mike
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-03 01:57
(Received via mailing list)
I did see this mentined in some article and its frustrating not to
find any pointers.

thanks for trying to help =)
02f45974a11b1c6eb123028048bf277a?d=identicon&s=25 Sean O'Hara (Guest)
on 2007-06-03 16:03
(Received via mailing list)
D8bdf72ae5ca202c0997ac3a04b1bf5f?d=identicon&s=25 Nathan Amick (Guest)
on 2007-06-03 16:42
(Received via mailing list)
What I do in this case is create the form_remote_for inside a hidden
div (style="display:none") then toggle that hidden div with something
like:

link_to_function('edit', visual_effect(:toggle_appear,
'the_hidden_form_div'))

If you want to be able to click on multiple fields and edit them all,
you could do something like this:

<div id="fields" onclick="$('fields').hide();$('edit').show()">
  Field 1: <%= @model.name %><br />
  Field 2: <%= @model.description %>
</div>

<div id="edit" style="display:none">
  <% form_remote_for :model..... do |f| %>
    <%= f.text_field, :name %><br />
    <%= f.text_area, :description %><br />
    <%= submit_tag 'Save' %>
    <%= link_to_function 'Cancel', "$('edit').hide();$
('fields').show()" $>
  <% end %>
</div>


I usually put something like the above into a partial, then use RJS to
reload that partial after the remote save.

Hope this helps.

-=nathan
F6f1bb179f57640efd981e3a18448f71?d=identicon&s=25 idealguru@gmail.com (Guest)
on 2007-06-06 08:57
(Received via mailing list)
Thanks Nathan!

That was in line with what I was looking for :=)
D918469295d6e8a9616a455900570495?d=identicon&s=25 Pramod Zade (pramod123)
on 2014-02-10 14:37
Hi,

Can you explaine me all process that means which files is include and
how to apply it because of i want it in cake php and prototype
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2014-02-10 14:46
(Received via mailing list)
On 10 February 2014 13:37, Pramod Zade <lists@ruby-forum.com> wrote:
> Hi,
>
> Can you explaine me all process that means which files is include and
> how to apply it because of i want it in cake php and prototype

Firstly are you familiar with Rails?  If not then first work right
through a good tutorial such as railstutorial.org (which is free to
use online).  That should show you the basics of rails.

Colin
This topic is locked and can not be replied to.