Asset-Tracker/app/controllers/comments_controller.rb

9 lines
239 B
Ruby
Raw Normal View History

2011-06-15 01:08:28 +00:00
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