Controller is to app.rb ; view is to layout folder ; rjs tem

any help with this analogy? i have an rjs template that goes along with
a method
i have in application.rb and the functionality will be used from many
diff
controllers (the method take a tag as param to accomplish some AJAX
acrobatics)… just trying to stay DRY here. is there no other way other
than
sticking the same rjs template in each view folder that uses this
functionality?
i guess i could do some inline rjs in the method, but depending on where
this
goes that could get VERY messy.

thanks in advance!
stuart

On 8/18/06, Stuart W. [email protected] wrote:

i guess i could do some inline rjs in the method, but depending on where
this
goes that could get VERY messy.

thanks in advance!
stuart

There’s plenty of precedent for sharing view templates, and RJS is no
different. The idiomatic way is to make a folder ‘app/views/shared’ and
stick your template in there. Then, when you’re rendering you add
:template
=> ‘shared/foo’ to the options.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs