私のレールアプリには、属性を持つユーザーモデルがあります: ポイント
class User < ActiveRecord::Base
attr_accessible :points
has_many :answers
end
特定のコントローラ アクションからのみ属性を更新する方法はありますか?
class AnswersController < ApplicationController
....
def create
@user = current_user
@answer = @user.answers.build(params[:answer])
if @answer.save
@user.points += 10 # <-- I want to make points updatable only from this action
@user.save
else
...
end
...
end