Attaching user to comment

How would I add a user name along with the form input? The user name
is defined in application.rb as @current_user

Below works 100% w/ adding the comment body/time but I wasnt sure how
to add the user part


def comment
@albums = Albums.find(params[:id])
@albumscomment =
if and
flash[:notice] = ‘comment submission succeeded!’
redirect_to :action => ‘show’, :permalink => @albums.permalink

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs