Displaying 2 results from an estimated 2 matches for "require_javascript".
2006 Jan 03
1
RequireResourceHelper for JS and CSS
...el="Stylesheet" type="text/css" />
If the files don''t exist, the above HTML won''t be included.
In the case that the CSS or JS is not named ''by convention'' as a file
that corresponds with the controller''s name, I use the
"require_javascript" code. In one of my views (index.rhtml, for
example):
<% require_javascript ''popitup'' %>
Then, I can call the js function popitup later:
<%= link_to_function "click me", "popitup(''#{url_for :action =>
''click''}'...
2005 Jun 29
14
Unobtrusive scripting?
Currently, pages generated by Rails tend to be sprinkled with
JavaScript. This happens, because the various helper methods work only
locally and simply append to the output.
In order to hide the JavaScript away, rendering would probably have to
be changed. A way I can think of is that a page-specific script is
included in the head of the document and JavaScript code is not written
to the