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 delete_multiple
    @user = current_user
    @works = Work.joins(:pseuds => :user).where("users.id = ?", @user.id).where(:id => params[:work_ids]).readonly(false)
    titles = @works.collect(&:title)
    @works.each do |work|
      work.destroy
    end
    flash[:notice] = ts("Your works %{titles} were deleted.", :titles => titles.join(", "))
    redirect_to show_multiple_user_works_path(@user)
  end
def delete_multiple @user = current_user @works = Work . joins ( :pseuds => :user ) . where ( "users.id = ?" , @user . id ) . where ( :id => params [ :work_ids ] ) . readonly ( false ) titles = @works . collect ( & :title ) @works . each do | work | work . destroy end flash [ :notice ] = ts ( "Your works %{titles} were deleted." , :titles => titles . join ( ", " ) ) redirect_to show_multiple_user_works_path ( @user ) 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