app/controllers/phcmemberspro/members/mains_controller.rb in phcmemberspro-2.2.3 vs app/controllers/phcmemberspro/members/mains_controller.rb in phcmemberspro-2.2.4

- old
+ new

@@ -8,11 +8,11 @@ layout 'layouts/phcmemberspro/members/members_all.html.erb' before_action :set_members_main, only: [:show, :edit, :update, :destroy] # Member Profile List def index - @members_mains = Members::Main.scoped_to(current_account) + @members_main = Members::Main.scoped_to(current_account) end # Detailed Member Profile def show end @@ -36,27 +36,27 @@ end end # Update Member Profile Action def update - if @members_main.scoped_to(current_account).update(members_main_params) + if @members_main.update(members_main_params) redirect_to members_mains_path, notice: 'Member profile was successfully updated.' else render :edit end end # Delete Member Profile Action def destroy - @members_main.scoped_to(current_account).destroy + @members_main.destroy redirect_to members_mains_path, notice: 'Member profile was successfully destroyed.' end private # Common Callbacks def set_members_main - @members_main = Members::Main.scoped_to(current_account).find(params[:id]) + @members_main = Members::Main.find(params[:id]) end # White List def members_main_params params.require(:members_main).permit(:mfirstname, :mlastname, :mtitle, :memail, :mphone, :mnotes, :account_id)