Execute Javascript When Using Link_to_function To Include a Partial in Rails
If you use the link_to_function to replace content in a div with content from a partial, any javascript that you include in the partial will not be executed. It is instead included, but will do nothing. Obviously, this isn't the desired behavior. Why woul...
Written by Sean Behan on 06/17/2012
Scope Routes/URLs By Username (like Twitter) in Your Rails Application
There are a few things that need to be taken care of before you can get this to work. The first thing (although, any of the following steps can be done in any order) to take care of involves your User model. You need to override the to_param method, so th...
Written by Sean Behan on 06/17/2012
A Through Z
How to print the alphabet in Rails very easily.
("A".."Z").each {|letter| link_to letter, "/#{letter"}
"A".upto("Z") {|letter| link_to letter, "/#letter"}
Written by Sean Behan on 06/17/2012
link_to_function Rails Ajax Reference
Link_to_function syntax for Haml template. Notice the "|" pipe which will allow for new lines in your code.
= link_to_function( "Add Line Item") |
{|page| page.insert_html :bottom, :invoice_line_items, |
:partial => "line_item", :locals=>{:line_item=...
Written by Sean Behan on 06/17/2012