Issue 21: Creating two tags with the same name gives a NoMethodError in Admin/tagsController#create
Status:  Fixed
Owner: ----
Closed:  Apr 2008
Reported by edmundo...@gmail.com, Feb 22, 2008
What steps will reproduce the problem?
1. Go to the admin section.
2. Create one tag, try to create another with the same name.

What is the expected output? What do you see instead?
It should popup a warning. An error rendered as a partial.

What version of the product are you using? On what operating system?
trunk. Ubuntu 7.04

Please provide any additional information below.

NoMethodError in Admin/tagsController#create

undefined method `render_text' for #<Admin::TagsController:0xb6a5c880>

RAILS_ROOT: /home/edmundo/workspace_aptana/substruct_rel_1-0-a2
Application Trace | Framework Trace | Full Trace

vendor/plugins/substruct/app/controllers/admin/tags_controller.rb:48:in
`create'
...

In tags_controller:

...
def create
  @tag = Tag.new(params[:tag])
  if params[:id]
    @tag.parent_id = params[:id]
  end
  if @tag.save
    render(:partial => 'tag_list_row', :locals => {:tag_list_row => @tag})
  else
    render_text ""
  end
end
...

When not saved, it tries to render nothing, and render_text is a deprecated
method, use render :text => "" instead.

Regards.

Feb 22, 2008
#1 edmundo...@gmail.com
It happens if you click "Save New Tag" with the field empty too.
Apr 8, 2008
Project Member #2 subim...@gmail.com
Fixed by rev #47
Status: Fixed