Asset-Tracker/app/controllers/comments_controller.rb
2011-06-14 18:08:28 -07:00

9 lines
239 B
Ruby
Executable File

class CommentsController < ApplicationController
def create
@asset = Asset.find(params[:asset_id])
params[:comment][:commenter] = current_user.name
@comment = @asset.comments.create!(params[:comment])
redirect_to @asset
end
end