Mk 27 wrote:
> Is there a shortcut for this kind of thing:
> 
> <%if X=42%>
>      <script type="text/javascript>
>           some_funct()
>      </script>
> <%end%>

I'm not sure, but if there isn't, a helper method would be trivial to 
write.  However, you probably shouldn't be writing that sort of code in 
the first place:

* "if X=42" should be "if x == 42".
* JavaScript belongs in external files, not in the view.  (Just like CSS 
-- although you *can* include it inline, it's a very bad idea.)
* Depending on what you're doing, this may be too much logic for the 
view.

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to