Hello, I have been having trouble even learning what to search for on this issue, so please bear with me. My page with an issue has two relevant divs: * one div contains a list of enrolled users in a class * the other div contains a search box where you can search for members to add to the class, then click to add them I can add and remove members just fine using form_remote_for, and my rjs template works in general. My issue: When a user clicks the button to enroll a user, I want to empty/hide the table row containing the record to show that their click worked. I could just rebuild the entire table each time they click, but this will cause the user interface issues - and it seems wasteful. I can do this by hand coding an ID, but I don''t understand enough ruby to create the right kind of variable. My RJS page: # This line recreates the div with the current list of enrolled users page.replace_html :enrolledusers, :partial => "enrolledusers", :object => @csession ## This line is my test line, and given a table cell with an id="customer_1202" it does the correct thing. page.replace_html :customer_1202, "" Normally I wouldn''t waste a post on this kind of question as it seems like something I should have figured out, but all my research leads me to believe everyone else already knows how to do it. Many thanks, Dustin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi.
the row you want has to have an id:
<tr id="something">
<td>blah</td>
<td>another blah</td>
</tr>
then in the rjs you can:
page.hide("something'')
and that will work fine.
Julian.
Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
VIDEO #3 out NOW!
http://sensei.zenunit.com/
On 08/04/2008, at 11:45 AM, Tubahead wrote:
>
> Hello,
>
> I have been having trouble even learning what to search for on this
> issue, so please bear with me.
>
> My page with an issue has two relevant divs:
> * one div contains a list of enrolled users in a class
> * the other div contains a search box where you can search for members
> to add to the class, then click to add them
>
> I can add and remove members just fine using form_remote_for, and my
> rjs template works in general.
>
> My issue:
> When a user clicks the button to enroll a user, I want to empty/hide
> the table row containing the record to show that their click worked. I
> could just rebuild the entire table each time they click, but this
> will cause the user interface issues - and it seems wasteful. I can do
> this by hand coding an ID, but I don''t understand enough ruby to
> create the right kind of variable.
>
> My RJS page:
>
> # This line recreates the div with the current list of enrolled users
> page.replace_html :enrolledusers, :partial => "enrolledusers",
:object
> => @csession
>
> ## This line is my test line, and given a table cell with an
> id="customer_1202" it does the correct thing.
>
> page.replace_html :customer_1202, ""
>
> Normally I wouldn''t waste a post on this kind of question as it
seems
> like something I should have figured out, but all my research leads me
> to believe everyone else already knows how to do it.
>
> Many thanks,
>
> Dustin
>
>
>
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
I have an ID to refer to, but I don''t know how to issue a variable
quite right.
I imaged something like:
:customer#{customer.id} - but I know this isn''t right.
Oh ... never mind. page.hide("") take a text value from your example.
Let me go try this out, I appreciate your help.
<tr id="customer_990">
<td>firstname, lastname</td>
<td>
<form action="/csessions/3" class="edit_csession"
id="edit_csession_3" method="post"
.......
</form>
</td>
</tr>
On Apr 7, 9:48 pm, Julian Leviston
<jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org>
wrote:> Hi.
>
> the row you want has to have an id:
>
> <tr id="something">
> <td>blah</td>
> <td>another blah</td>
> </tr>
>
> then in the rjs you can:
>
> page.hide("something'')
>
> and that will work fine.
>
> Julian.
>
> Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
> VIDEO #3 out NOW!http://sensei.zenunit.com/
>
> On 08/04/2008, at 11:45 AM, Tubahead wrote:
>
>
>
> > Hello,
>
> > I have been having trouble even learning what to search for on this
> > issue, so please bear with me.
>
> > My page with an issue has two relevant divs:
> > * one div contains a list of enrolled users in a class
> > * the other div contains a search box where you can search for members
> > to add to the class, then click to add them
>
> > I can add and remove members just fine using form_remote_for, and my
> > rjs template works in general.
>
> > My issue:
> > When a user clicks the button to enroll a user, I want to empty/hide
> > the table row containing the record to show that their click worked. I
> > could just rebuild the entire table each time they click, but this
> > will cause the user interface issues - and it seems wasteful. I can do
> > this by hand coding an ID, but I don''t understand enough ruby
to
> > create the right kind of variable.
>
> > My RJS page:
>
> > # This line recreates the div with the current list of enrolled users
> > page.replace_html :enrolledusers, :partial =>
"enrolledusers", :object
> > => @csession
>
> > ## This line is my test line, and given a table cell with an
> > id="customer_1202" it does the correct thing.
>
> > page.replace_html :customer_1202, ""
>
> > Normally I wouldn''t waste a post on this kind of question as
it seems
> > like something I should have figured out, but all my research leads me
> > to believe everyone else already knows how to do it.
>
> > Many thanks,
>
> > Dustin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
Very cool !!
This is what I used:
page.hide("customer_#{@cust.id}")
Thank you very much ...
On Apr 7, 9:54 pm, Tubahead
<dustin.tenn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> I have an ID to refer to, but I don''t know how to issue a variable
> quite right.
> I imaged something like:
> :customer#{customer.id} - but I know this isn''t right.
>
> Oh ... never mind. page.hide("") take a text value from your
example.
>
> Let me go try this out, I appreciate your help.
>
> <tr id="customer_990">
>
> <td>firstname, lastname</td>
> <td>
> <form action="/csessions/3"
class="edit_csession"
> id="edit_csession_3" method="post"
> .......
> </form>
> </td>
> </tr>
>
> On Apr 7, 9:48 pm, Julian Leviston
<jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote:
>
> > Hi.
>
> > the row you want has to have an id:
>
> > <tr id="something">
> > <td>blah</td>
> > <td>another blah</td>
> > </tr>
>
> > then in the rjs you can:
>
> > page.hide("something'')
>
> > and that will work fine.
>
> > Julian.
>
> > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
> > VIDEO #3 out NOW!http://sensei.zenunit.com/
>
> > On 08/04/2008, at 11:45 AM, Tubahead wrote:
>
> > > Hello,
>
> > > I have been having trouble even learning what to search for on
this
> > > issue, so please bear with me.
>
> > > My page with an issue has two relevant divs:
> > > * one div contains a list of enrolled users in a class
> > > * the other div contains a search box where you can search for
members
> > > to add to the class, then click to add them
>
> > > I can add and remove members just fine using form_remote_for, and
my
> > > rjs template works in general.
>
> > > My issue:
> > > When a user clicks the button to enroll a user, I want to
empty/hide
> > > the table row containing the record to show that their click
worked. I
> > > could just rebuild the entire table each time they click, but
this
> > > will cause the user interface issues - and it seems wasteful. I
can do
> > > this by hand coding an ID, but I don''t understand enough
ruby to
> > > create the right kind of variable.
>
> > > My RJS page:
>
> > > # This line recreates the div with the current list of enrolled
users
> > > page.replace_html :enrolledusers, :partial =>
"enrolledusers", :object
> > > => @csession
>
> > > ## This line is my test line, and given a table cell with an
> > > id="customer_1202" it does the correct thing.
>
> > > page.replace_html :customer_1202, ""
>
> > > Normally I wouldn''t waste a post on this kind of
question as it seems
> > > like something I should have figured out, but all my research
leads me
> > > to believe everyone else already knows how to do it.
>
> > > Many thanks,
>
> > > Dustin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
If you''re in Rails 2.x you can: page.hide dom_id(@cust) On Apr 7, 9:58 pm, Tubahead <dustin.tenn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Very cool !! > > This is what I used: > page.hide("customer...-LYx9vhtpFZI@public.gmane.org}") > > Thank you very much ... > > On Apr 7, 9:54 pm, Tubahead <dustin.tenn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I have an ID to refer to, but I don''t know how to issue a variable > > quite right. > > I imaged something like: > > :customer#{customer.id} - but I know this isn''t right. > > > Oh ... never mind. page.hide("") take a text value from your example. > > > Let me go try this out, I appreciate your help. > > > <tr id="customer_990"> > > > <td>firstname, lastname</td> > > <td> > > <form action="/csessions/3" class="edit_csession" > > id="edit_csession_3" method="post" > > ....... > > </form> > > </td> > > </tr> > > > On Apr 7, 9:48 pm, Julian Leviston <jul...-AfxEtdRqmE/tt0EhB6fy4g@public.gmane.org> wrote: > > > > Hi. > > > > the row you want has to have an id: > > > > <tr id="something"> > > > <td>blah</td> > > > <td>another blah</td> > > > </tr> > > > > then in the rjs you can: > > > > page.hide("something'') > > > > and that will work fine. > > > > Julian. > > > > Learn Ruby on Rails! Check out the FREE VIDS (for a limited time) > > > VIDEO #3 out NOW!http://sensei.zenunit.com/ > > > > On 08/04/2008, at 11:45 AM, Tubahead wrote: > > > > > Hello, > > > > > I have been having trouble even learning what to search for on this > > > > issue, so please bear with me. > > > > > My page with an issue has two relevant divs: > > > > * one div contains a list of enrolled users in a class > > > > * the other div contains a search box where you can search for members > > > > to add to the class, then click to add them > > > > > I can add and remove members just fine using form_remote_for, and my > > > > rjs template works in general. > > > > > My issue: > > > > When a user clicks the button to enroll a user, I want to empty/hide > > > > the table row containing the record to show that their click worked. I > > > > could just rebuild the entire table each time they click, but this > > > > will cause the user interface issues - and it seems wasteful. I can do > > > > this by hand coding an ID, but I don''t understand enough ruby to > > > > create the right kind of variable. > > > > > My RJS page: > > > > > # This line recreates the div with the current list of enrolled users > > > > page.replace_html :enrolledusers, :partial => "enrolledusers", :object > > > > => @csession > > > > > ## This line is my test line, and given a table cell with an > > > > id="customer_1202" it does the correct thing. > > > > > page.replace_html :customer_1202, "" > > > > > Normally I wouldn''t waste a post on this kind of question as it seems > > > > like something I should have figured out, but all my research leads me > > > > to believe everyone else already knows how to do it. > > > > > Many thanks, > > > > > Dustin--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---