Sha256: 786f116b94e787acbbaf468a3f22cf9c1b3c8a3e693301c9df2c6ad62cc87d89
Contents?: true
Size: 963 Bytes
Versions: 27
Compression:
Stored size: 963 Bytes
Contents
class ProfilesController < ApplicationController before_filter :authenticate_user!, :except => [ :show ] respond_to :html, :js def show subject_profile end def edit current_profile end def update current_profile.update_attributes profile_params respond_to do |format| format.html{ redirect_to [profile_subject, :profile] } format.js end end private def profile_params params. require(:profile). permit(:organization, :birthday, :city, :country, :description, :phone, :mobile, :fax, :address, :website, :experience, actor_attributes: [ :id, :name, :email, :tag_list ]) end def subject_profile @profile ||= profile_subject!.profile end def current_profile @profile ||= find_current_profile end def find_current_profile unless profile_subject!.represented_by?(current_subject) raise CanCan::AccessDenied end current_subject.profile end end
Version data entries
27 entries across 27 versions & 2 rubygems