How would you implement a save and create another feature on a model in rails 3?
I'm trying to implement a save and create another instance of a开发者_开发百科 model but I can't understand how routing works.
def save_and_create
@book_condition = BookCondition.new(params[:book])
if @book_condition.save
flash[:notice] = t('app.messages.success')
redirect_to new_book_condition_url
else
render :action => 'new'
end
end
Above is what I wrote. How would you do it? How would you route it?
Thanks
精彩评论