This project is archived and is in readonly mode.
script/destroy scaffold
Reported by Marko | January 7th, 2009 @ 05:28 PM | in 3.x
I have created custom scaffold which sets up route like this in manifest: route map.resources :articles, :member => {:da_state => :put, :ne_state => :put}, :path_prefix => ':locale/admin'
Which is fine when doing script/generate, but on destroy I get error:
route map.resources :articles, :member => {:da_state => :put, :ne_state => :put}, :path_prefix => ':locale/admin'
/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails_generator/commands.rb:531:
warning: regexp has invalid interval
/usr/lib/ruby/gems/1.8/gems/rails-2.2.2/lib/rails_generator/commands.rb:531:
warning: regexp has }' without escape
Problem seams to be fixed after escaping regex in: vendor/rails/railties/lib/rails_generator/commands.rb:531
def route_resources(*resources)
resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
look_for = "\n map.resources #{resource_list}\n"
logger.route "map.resources #{resource_list}"
- gsub_file 'config/routes.rb', /(#{look_for})/mi, ''
+ gsub_file 'config/routes.rb', /(#{Regexp.escape(look_for)})/mi, ''
end
Comments and changes to this ticket
-
Pratik March 8th, 2009 @ 12:09 AM
- Assigned user set to Pratik
- State changed from new to incomplete
Looks ok to me. Could you please submit a proper patch ? http://guides.rails.info/contrib... would be helpful.
Thanks !
-
Mike Breen March 26th, 2009 @ 02:45 PM
- Tag set to 2.3.2, generator, patch, resource, scaffold
I put Marco's fix into a patch.
-
Pratik March 26th, 2009 @ 02:45 PM
- State changed from incomplete to open
-
Rohit Arondekar June 19th, 2010 @ 08:56 AM
Any updates to this ticket? Is this still an issue in rails 2.3.8 or Rails master?
-
José Valim June 21st, 2010 @ 10:19 AM
- State changed from open to resolved
This is definitely fixed on master.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>