“Changing the class of a div using rails NOT JS”

December 9, 2008 at 4:01 pm Leave a comment

Consider we need to change the class of a particular DIV/SPAN , I was wondering how we could have done using some default rails method and NOT Javascript as what we can do in Javascript the same we can do using Rails but in lesser time and number of lines of code.
Using google with the correct key words resulted in the following

Javascript

function change(id, newclass)
{
identity=document.getElementById(id);
identity.className=newclass;
}

Rails

page["task_#{params[:id]}”].toggle_class_name “completed”

, , ,

Entry filed under: javascript, mumbai, rails, videos. Tags: , .

“SQL inner joins the right way “ “Sum/Avg method in Rails , save a query”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


Recent Posts

Pages


Follow

Get every new post delivered to your Inbox.