Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
## index.rhtml <%= link_to_remote 'Join us!', :url => { :controller => 'users', :action => 'create' }, :method => :get, :href => { :controller => 'users', :action => 'create' } %> ## users_controller.rb def create if request.xhr? && request.get? # Petición Ajax con GET - Render de la vista sin el layout render :layout => false return end # Petición no Ajax y GET - Render de la vista con layout return if request.get? # Petición (Ajax o no) con POST - Se crea el usuario @user = User.new #... end
This paste will be private.
From the Design Piracy series on my blog: