======================================================================
Here is the controller:
def create @category = Category.new(@params[:category])
if @category.save @new_item = Category.find_by_sql(“select max(category) as
last_category, id from categories”)
render_text “
” + @new_item[:id] + “
” + @new_item[:category] + “
”
else
render_action ‘new’
end
end
I’m a complete newbie, any help would be appreciated.
======================================================================
Here is the controller:
def create @category = Category.new(@params[:category])
if @category.save @new_item = Category.find_by_sql(“select max(category) as
last_category, id from categories”)
render_text “
” + @new_item[:id] + “
” + @new_item[:category] + “
”
else
render_action ‘new’
end
end
I’m a complete newbie, any help would be appreciated.
Thanks,
Bill
I forgot to mention, my view controller also has the following input
field:
<%= text_field “category”, “category”, “size”=>20, “maxlength”=>20 %>