You shouldn't need to play with the data-rapid attribute if you're
using an existing tag. You may need to understand it if you're
creating a new jQuery tag, so more documentation is probably
warranted, but if you're just using an existing tag, you shouldn't
need to play with it directly.
In this case, try:
<dialog-box id="dialog-for-item-#{this.id}" ...>...</dialog-box>
<dialog-open-button dialog="#dialog-for-item-#{this.id}"/>
Note the two different uses for hash. #{...} is for embedded ruby,
but "#dialog-..." is a CSS selector.
Also note the two different meanings of ID. There's the ActiveRecord
ID (this.id), and there's the CSS ID (dialog-for-item-17). We're
using one to build the other but they are distinct.
Bryan
On Sun, Jul 1, 2012 at 5:08 PM, devcurmudgeon <[email protected]> wrote:
> I'm trying to understand the new data_rapid mechanism. Currently we've got a
> a single popup edit dialog for "items" which is populated dynamically for a
> selected "item" using a Hobo.ajaxRequest in JavaScript. I'm guessing there's
> a more elegant way to do this in 1.4 - am I on the right track with the
> following in dryml, where the context is the "item" i want to create an edit
> dialog for?
>
> <dialog-open-button data-rapid='{"dialog-box":{"item_id":
> #{this.id}}}'><this.title/></dialog-open-button>
>
> It gives the following:
>
> NoMethodError: private method `status_code' called for
> #<ActionDispatch::ExceptionWrapper:0x000001054b5d38>
>
> ActionView::Template::Error (757: unexpected token at
> '{"dialog-box":{"item_id": #{this.id}}}'):
>
>
>
>
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/tDyuKfRW4mMJ.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.
--
You received this message because you are subscribed to the Google Groups "Hobo
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/hobousers?hl=en.