Forum: Ruby Building Strings

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.
C4bd59695df68a428fc2f7a165d59a19?d=identicon&s=25 Will Merydith (wmerydith)
on 2006-04-19 23:16
I need to build the DOM id for my RJS template using an id passed to the
template.  How do I add the value of an id paramater to get the DOM id I
need.  For example given this call in my RJS template:

page.replace_html "list", :partial => "show_new_list"

I want "list" to be "list" + the id I pass in.

Thanks.
31ab75f7ddda241830659630746cdd3a?d=identicon&s=25 Austin Ziegler (Guest)
on 2006-04-19 23:28
(Received via mailing list)
On 4/19/06, Will Merydith <will.merydith@gmail.com> wrote:
> I need to build the DOM id for my RJS template using an id passed to the
> template.  How do I add the value of an id paramater to get the DOM id I
> need.  For example given this call in my RJS template:
>
> page.replace_html "list", :partial => "show_new_list"
>
> I want "list" to be "list" + the id I pass in.

You're *probably* going to get a better answer on the rails list
http://lists.rubyonrails.org/mailman/listinfo/rails than here, but you
could do:

page.replace_html "list#{id}", :partial => "show_new_list"

Maybe.

-austin
C4bd59695df68a428fc2f7a165d59a19?d=identicon&s=25 Will Merydith (wmerydith)
on 2006-04-20 00:05
Austin Ziegler wrote:
> On 4/19/06, Will Merydith <will.merydith@gmail.com> wrote:
>> I need to build the DOM id for my RJS template using an id passed to the
>> template.  How do I add the value of an id paramater to get the DOM id I
>> need.  For example given this call in my RJS template:
>>
>> page.replace_html "list", :partial => "show_new_list"
>>
>> I want "list" to be "list" + the id I pass in.
>
> You're *probably* going to get a better answer on the rails list
> http://lists.rubyonrails.org/mailman/listinfo/rails than here, but you
> could do:
>
> page.replace_html "list#{id}", :partial => "show_new_list"
>
> Maybe.
>
> -austin


That worked thanks!  I need to get a good Ruby primer.  I'm a java
developer trying our RoR and I really like the framework but I am
limited by my lack of experience with the Ruby syntax.
57e939ff00f9df2670a09f417c08da5e?d=identicon&s=25 Josh Knowles (Guest)
on 2006-04-20 00:23
(Received via mailing list)
On 4/19/06, Will Merydith <will.merydith@gmail.com> wrote:

> That worked thanks!  I need to get a good Ruby primer.  I'm a java
> developer trying our RoR and I really like the framework but I am
> limited by my lack of experience with the Ruby syntax.



http://www.manning.com/black/
This topic is locked and can not be replied to.