Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
fixing new item path in nifty scaffold
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Feb 14, 2011
1 parent 43ff103 commit 46eee6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/generators/nifty/scaffold/scaffold_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ def items_path
def item_path(options = {})
if action? :show
name = options[:instance_variable] ? "@#{instance_name}" : instance_name
if %w(new edit).include? options[:action].to_s
"#{options[:action].to_s}_#{item_resource}_path(#{name})"
if options[:action].to_s == "new"
"new_#{item_resource}_path"
elsif options[:action].to_s == "edit"
"edit_#{item_resource}_path(#{name})"
else
if scaffold_name.include?('::') && !@namespace_model
namespace = singular_name.split('/')[0..-2]
Expand Down

0 comments on commit 46eee6a

Please sign in to comment.