On 19 Apr 2008, at 23:48, Col Wilson wrote:
>
> I know it''s not desirable to use ERB inside the controller in
theory,
> but I think I really need and I''m having problems.
>
> I am using GMap the Google Map helper and all the coding for the
> markers (pop-ups) is done inside the controller. So often you do
> something like:
>
> markers << GMarker.new([obj.lat, obj.lng],
> :title => obj.name,
> :info_window => "Bob''s House",
> :icon => obj.gicon
> )
>
> but instead of a boring plain text in the info_window I wanted to use
> ajax links to dynamically update divs. Thus i would be nice to use
> e.g. link_to_remote and friends, but since that is in a view helper I
> can''t use can I? Must I resort to raw javascript?
You can just include the relevant helper modules into your controller.
Slightly more clean is to have a helpers object into which you include
all those modules. You then have to say helpers.link_to_remote but you
don''t end up with dozens of methods added to your controller.
Fred
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---