Created
September 16, 2010 15:37
-
-
Save itsderek23/582635 to your computer and use it in GitHub Desktop.
Sample Raplet Rails Controller Action
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def raplet | |
html="" | |
email=params[:email] | |
if retrieve_user | |
html=render_to_string :layout=>false | |
end | |
res={:html=>html,:status=>200, :css=>'a{color:blue} ul{padding-left:20px;margin:4px 0;} link{color:blue;cursor:hand}', :js=>"$('.details-link').click(function(){ $('#'+this.id.replace('l','a')).toggle()})"} | |
render :text=>params[:callback]+"("+res.to_json+")" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment