(Rails) How do I reference resources from non-restful views...?

Posted by humble_coder on Stack Overflow See other posts from Stack Overflow or by humble_coder
Published on 2009-07-12T03:46:13Z Indexed on 2010/05/12 13:04 UTC
Read the original article Hit count: 132

Hi All,

How do you ensure that your javascript includes get included properly for all files everywhere using a particular layout? Basically I have some non-restful actions that I've added. I haven't added any ROUTES for them, however, using normal text rendering works fine. It's when I start requiring different "swf" and "js" files (files which are properly placed in PUBLIC) that things get hairy. I start receiving "406 Not Acceptable" errors telling me that it's looking for the files in a subdirectory of the current controller.

As it stands I'm in including the JS in "application" layout file. It works for the INDEX action, but doesn't seem to work for any of the non-restful actions.

Thoughts?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about JavaScript