Topic: Controller / Model refactoring
I have a very simple question. I have the following controller snippet
@model = Product.new(params[:model])
@model.wholesaler_id = params[:model][:wholesaler_id].to_i
@model.categeory = "Default"
if request.post? and @model.save
@model.tag_with(@model.tagging_tags || "") if @config[:tags][:status]
flash[:success] = "Complete"
Is there anyway that the default values for wholesaler_id and category can be set in the product model instead of the way I did it... This might be the correct way I'm doing it, but I'm sure there is a much more elegant approach using the model
Thanx in advance guys