# HG changeset patch # User edogawaconan # Date 1397463202 -32400 # Node ID 430dadffd91ed5aa66000530cd833864295c59c0 # Parent 2dda4100cb82883940a09c626efeab5972af8f5a Fix coding style. diff -r 2dda4100cb82 -r 430dadffd91e app/controllers/pastes_controller.rb --- a/app/controllers/pastes_controller.rb Mon Apr 14 16:48:19 2014 +0900 +++ b/app/controllers/pastes_controller.rb Mon Apr 14 17:13:22 2014 +0900 @@ -5,7 +5,7 @@ # GET /1.txt def show @paste = Paste.safe_find(params[:id]) - head :not_found and return unless @paste + return head :not_found unless @paste respond_to do |format| format.html { cache } @@ -28,13 +28,13 @@ # POST /pastes.json # POST /pastes.txt def create - @paste = Paste.new(paste_params.merge(ip: request.remote_ip)) + @paste = Paste.new paste_params.merge(:ip => request.remote_ip) begin respond_to do |format| if @paste.save @fresh = true - format.html { redirect_to @paste, :notice => 'Paste was successfully created.' } + format.html { redirect_to @paste, :notice => "Paste was successfully created." } format.json { render :json => @paste, :status => :created, :location => @paste } else flash.now[:alert] = @paste.errors.full_messages.to_sentence @@ -68,8 +68,9 @@ def lowercase_path correct_path = request.fullpath.downcase - redirect_to correct_path, :status => :moved_permanently unless - correct_path == request.fullpath + unless correct_path == request.fullpath + redirect_to correct_path, :status => :moved_permanently + end end def cache_key(format = request.format.symbol)