Forum: Ruby on Rails rjs variable substitution problem

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.
7ed559ec7f9fc6a96ddc1690f06e7f80?d=identicon&s=25 Chris Olsen (chrisolsen)
on 2007-05-28 04:56
(Received via mailing list)
I keep getting javascript alerts messages basically telling me that it
can't find the element.  It obviously has something to do with the
group.id value not being put in it's place properly.

here is the action method
[code=]def list_all
  @group = TaskGroup.find(params[:id])
end
[/code]

Here is the rjs script
[code=]page.hide 'task_group-#{group.id}'
page.replace_html 'task_group-#{group.id}', :partial => "tasks/
task", :collection => @group.tasks
page.visual_effect :blind_down, 'task_group-#{group.id}'
[/code]

I have tried with and without the @, and am somewhat confused when to
use the #{} vs the <%= %>, I am assuming rls files always use the #{}
since most of the examples that I have seen use it that way.

Thanks for the help
83c8cca11558f32207645ca270ae8475?d=identicon&s=25 sishen (Guest)
on 2007-05-28 05:29
(Received via mailing list)
use "" instead of ''
7ed559ec7f9fc6a96ddc1690f06e7f80?d=identicon&s=25 Chris Olsen (chrisolsen)
on 2007-05-28 06:48
(Received via mailing list)
I have changed things around so that, that particular rjs file is not
used anymore, but I will remember your tip for next time around.  I
didn't think that ror was sensitive about quote types.

Thanks for your help.
83c8cca11558f32207645ca270ae8475?d=identicon&s=25 sishen (Guest)
on 2007-05-29 06:35
(Received via mailing list)
On 5/28/07, chris <olsen.chris@gmail.com> wrote:
>
>
> I have changed things around so that, that particular rjs file is not
> used anymore, but I will remember your tip for next time around.  I
> didn't think that ror was sensitive about quote types.


Of course sensitive. "" will do replacement when needed, while '' will
not.

Thanks for your help.
This topic is locked and can not be replied to.