Commit 2a80ebc6 authored by marcheing's avatar marcheing

Use html for profile actions and not respond to json

Signed-off-by: Diego de Araújo Martinez Camarinha's avatarDiego Araújo <[email protected]>
parent 620171ce
Pipeline #3584198 passed with stage
in 5 minutes and 10 seconds
......@@ -3,8 +3,9 @@ class ProfilesController < ApplicationController
before_action :set_carmen_locale, only: [:show, :edit, :new, :states]
before_action :authenticate_user!, except: [:states]
respond_to :html
# GET /profiles/1
# GET /profiles/1.json
def show
end
......@@ -18,7 +19,6 @@ class ProfilesController < ApplicationController
end
# POST /profiles
# POST /profiles.json
def create
@profile = Profile.new(profile_params)
@profile.user_id = current_user.id
......@@ -26,35 +26,28 @@ class ProfilesController < ApplicationController
respond_to do |format|
if @profile.save
format.html { redirect_to root_path, notice: I18n.t('successfully_created_profile') }
format.json { render :show, status: :created, location: @profile }
else
format.html { render :new }
format.json { render json: @profile.errors, status: :unprocessable_entity }
end
end
end
# PATCH/PUT /profiles/1
# PATCH/PUT /profiles/1.json
def update
respond_to do |format|
if @profile.update(profile_params)
format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }
format.json { render :show, status: :ok, location: @profile }
else
format.html { render :edit }
format.json { render json: @profile.errors, status: :unprocessable_entity }
end
end
end
# DELETE /profiles/1
# DELETE /profiles/1.json
def destroy
@profile.destroy
respond_to do |format|
format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }
format.json { head :no_content }
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment