techvision/brails4

View on GitHub
app/controllers/admin/profiles_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class Admin::ProfilesController < AdminController

  def show
    @profile = User.find(params[:user_id]).profile
  end

  def edit
    @profile = User.find(params[:user_id]).profile
  end

  def update
    @profile = User.find(params[:user_id]).profile
    if @profile.update_attributes(profile_params)
      redirect_to admin_user_path(user.id), notice: "Profile successfully updated."
    else
      render_action :edit, alert: "Profile could not be updated."
    end
  end
end