app/controllers/works_controller.rb
# only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works
def cancel_posting_and_redirect
    if @work && @work.posted
      flash[:notice] = ts("The work was not updated.")
      redirect_to user_works_path(current_user)
    else
      flash[:notice] = ts("The work was not posted. It will be saved here in your drafts for one month, then deleted from the Archive.")
      redirect_to drafts_user_works_path(current_user)
    end
  end
def cancel_posting_and_redirect if @work && @work . posted flash [ :notice ] = ts ( "The work was not updated." ) redirect_to user_works_path ( current_user ) else flash [ :notice ] = ts ( "The work was not posted. It will be saved here in your drafts for one month, then deleted from the Archive." ) redirect_to drafts_user_works_path ( current_user ) end end
only registered users and NOT admin should be able to create new works
only registered users and NOT admin should be able to create new works