Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
def update #params[:map][:existing_asset_attributes] ||= {} @map = Map.find(params[:id]) unless current_user.has_role?("Administrator") @map.approved = false else @map.approved = true end @map.user_id = current_user.id respond_to do |format| if @map.update_attributes(params[:map]) flash[:notice] = @presenter.notify("notification", "Success", "Project was updated successfully.") format.html { redirect_to(admin_maps_path) } format.xml { head :ok } else format.html { redirect_to(admin_maps_path) do |page| page.call :alert, "Some javascript will be my method." end } flash[:notice] = @presenter.notify("error", "Error!", "There was an error editing your project.") #format.html { render :action => "edit" } #format.xml { render :xml => @map.errors, :status => :unprocessable_entity } end end end
This paste will be private.
From the Design Piracy series on my blog: