app/controllers/rocks_controller.rb
#If not authenticated, send back to welcome/home page. Otherwise, find rock, make sure the user is the 
#owner of the rock, rock updates and on to rocks/show view.
If not authenticated, send back to welcome/home page. Otherwise, find rock, make sure the user is the
owner of the rock, rock updates and on to rocks/show view.
If not authenticated send back to welcome / home page . Otherwise find rock make sure the user is the owner of the rock rock updates and on to rocks / show view .
def update
        @rock = Rock.find(params[:id])
        if @rock.user == current_user && @rock.valid? && @rock.update(rock_params)
            redirect_to rock_path(@rock)
        else
            render :edit
        end
    end
def update @rock = Rock . find ( params [ :id ] ) if @rock . user == current_user && @rock . valid? && @rock . update ( rock_params ) redirect_to rock_path ( @rock ) else render :edit end end
If not authenticated, send back to welcome/home page.
If not authenticated send back to welcome / home page .