Skip to content

Instantly share code, notes, and snippets.

@schowdhury
Created March 14, 2011 23:30
Show Gist options
  • Save schowdhury/870075 to your computer and use it in GitHub Desktop.
Save schowdhury/870075 to your computer and use it in GitHub Desktop.
barbones rails project with devise. enabled with cucumber/rspec/factory_girl
rails new playing_around -d mysql -T -J
# edit rmvrc file
# rvm use ruby-1.9.2@playing_around --create
gem install bundler
#add at least the following gems for cucumber and rspec testing. nifty generators are kinda cool too
#group :test, :development do
# gem 'cucumber-rails'
# gem 'rspec-rails'
# gem 'capybara'
# gem 'cucumber'
# gem 'autotest'
# gem 'factory_girl_rails'
#end
#gem "nifty-generators", :group => :development
#gem "devise"
#gem "jquery-rails", "0.2.7" #nifty generators will not work with version above this
#gem "mocha", :group => :test
bundle install
rails g cucumber:install --rspec --capybara
rails g rspec:install
rails g devise:install
rails g jquery:install --ui
#rails g nifty:layout
#rails g nifty:config
rake db:create db:migrate db:test:prepare
#----- Extra credit, the following will creates users with firstname and lastname you can skip this to do a standard devise create
#rails g migration add_first_name_last_name_to_users
# add_column :users, :firstname, :string
# add_column :users, :lastname, :string
# -----------
rails g devise User
rake db:create db:migrate db:test:prepare
# rails generate devise:views -- only if you want to customize devise views, as in below
add the following to _form.html.erb in the devise view
<p>
<%= f.label :firstname %><br />
<%= f.text_field :firstname %>
</p>
<p>
<%= f.label :lastname %><br />
<%= f.text_field :lastname %>
</p>
--------- index.html.erb and show.html.erb
<td><%= user.firstname %></td>
<td><%= user.lastname %></td>
#autotest
#application.rb change the following. bug in rails
#config.action_view.javascript_expansions[:defaults] = %w(rails.js)
rails s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment