Skip to content

Commit

Permalink
no need to set app name in 'config/routes.rb' file for Rails 4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielKehoe committed May 5, 2014
1 parent ce216ed commit 13d91d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.textile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
h1. CHANGELOG

h2. 2.6.3 unreleased

* no need to set app name in 'config/routes.rb' file for Rails 4.1

h2. 2.6.2 May 4, 2014

* don't include 'domain_name' in 'secrets.yml' file unless email option is selected
Expand Down
6 changes: 4 additions & 2 deletions recipes/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@
### SUBDOMAINS ###
copy_from_repo 'lib/subdomain.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains_app'
copy_from_repo 'config/routes.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains_app'
### CORRECT APPLICATION NAME ###
gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
unless rails_4_1?
# correct application name
gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
end
### GIT ###
git :add => '-A' if prefer :git, true
git :commit => '-qm "rails_apps_composer: routes"' if prefer :git, true
Expand Down

2 comments on commit 13d91d7

@mtearle
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a regression here when doing the following:

rails new mynewapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb

and going
3) Custom application (experimental)
etc..

It leaves behind:

Rails3DeviseRspecCucumber::Application.routes.draw do

in the corresponding config/routes.rb

(noted in RailsApps/rails-composer#178)

vagrant@rails-dev-box:~$ rails -v
Rails 4.1.1

Preferences:

  • git: true
  • apps4: none
  • dev_webserver: webrick
  • prod_webserver: passenger
  • database: sqlite
  • templates: erb
  • tests: rspec
  • continuous_testing: none
  • frontend: bootstrap3
  • email: smtp
  • authentication: devise
  • devise_modules: confirmable
  • authorization: pundit
  • form_builder: simple_form
  • starter_app: admin_app
  • rvmrc: false
  • local_env_file: figaro
  • better_errors: true
  • ban_spiders: true
  • jsruntime: true

@DanielKehoe
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @mtearle. Fixed with rails_apps_composer 2.6.9.

Please sign in to comment.