1
0
Fork 0
forked from OpenNeo/impress
impress/app/controllers/closet_lists_controller.rb

19 lines
558 B
Ruby

class ClosetListsController < ApplicationController
before_filter :authorize_user!
def new
@closet_list = current_user.closet_lists.build
end
def create
@closet_list = current_user.closet_lists.build params[:closet_list]
if @closet_list.save
flash[:success] = "Successfully saved \"#{@closet_list.name}\""
redirect_to user_closet_hangers_path(current_user)
else
flash.now[:alert] = "We can't save this list because: #{@closet_list.errors.full_messages.to_sentence}"
render :action => :new
end
end
end