Skip to content

Instantly share code, notes, and snippets.

@itsderek23
Created September 16, 2010 15:37
Show Gist options
  • Save itsderek23/582635 to your computer and use it in GitHub Desktop.
Save itsderek23/582635 to your computer and use it in GitHub Desktop.
Sample Raplet Rails Controller Action
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