Plugins - embedded_javascripts

StarAdd to favorites

Embedded JavaScripts v.1.0

====================

This plugin help you to integrate your server-side javascripts in your view.

The main problems of webmaster is pass vars to .js files.

The only way wose include your js in the view or put it on partials, but now, with Embedded JavaScripts all is most simple and good to look.

Make a new pure javascript file and give ejs extension and all are done!

Example:

def myview

        @var = "Hello World here"

end

myview.rhtml

        <%= include_javascript "mytest" %>

        Put wath you want here

test.ejs

        alert('<%= @var %>');

Result

                alert('Hello World here');

        Put wath you want here

Simple no????

Please visit http://blog.lipsiasoft.com and give me a good rating!

Davide D'Agostino (DAddYE)

http://blog.lipsiasoft.org

http://lipsiasoft.googlecode.com/svn/trunk/embedded_javascripts

Rails' (MIT)

  • Currently 4.8/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

View Extensions

Tags

Comments

Add a comment

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.

Have a comment?