Created
September 20, 2010 10:44
Rails 3 steps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Install rvm | |
http://rvm.beginrescueend.com/rvm/install/ | |
* Prepare the development environment update rvm whit ruby 1.9.2 and rails 3.0.0: | |
rvm update && rvm reload # update rvm | |
rvm install 1.9.2 | |
rvm use 1.9.2 | |
rvm gemset create rails3 | |
rvm --default 1.9.2@rails3 | |
which ruby # check to be sure the ruby interpretter is properly set to 1.9.2 | |
hash -r # if ruby interpretter is not pointing to 1.9.2 | |
gem install rails | |
which rails # check to be sure we are using rvm version of rails | |
----------------------------------------------------------------------------------- | |
* Install postgres | |
apt-get install postgresql | |
Use apt-file to resolve any library unknown file dependences | |
* Add user and create postgres databases | |
sudo su postgres | |
createuser --pwprompt (Introduce the user/pass for the app and set superuser = y) | |
createdb -E UTF8 -O <user> <db> | |
For BRMP: | |
createdb -E UTF8 -O biocomfort_rmp biocomfort_rmp_test | |
createdb -E UTF8 -O biocomfort_rmp biocomfort_rmp_development | |
exit | |
-------------------------------------------------------------------------------- | |
* Install the app: | |
bundle install | |
rake db:migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tutorial: http://github.com/binarylogic/authlogic_example | |
For run authlogic generator, first you must write the next line in the Gemfile: | |
gem 'authlogic', :git => 'git://github.com/odorcicd/authlogic.git', :branch => 'rails3' | |
Then, run: rails g authlogic:session user_session | |
Routing in Rails 3, for authlogic: | |
match 'logout' => 'user_sessions#destroy', :as => :logout | |
resource :user_session | |
resource :account, :controller => "users" | |
resources :users | |
root :to => "user_sessions#new" | |
In application.rb: | |
config.filter_parameters += [:password, :password_confirmation] | |
Install plugin 'dynamic_form' to support error_messages | |
Delete public/index.html | |
Cancan: http://github.com/ryanb/cancan/wiki/role-based-authorization |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gemfile: | |
group :development, :test do | |
gem 'capybara' | |
gem 'database_cleaner' | |
gem 'cucumber-rails' | |
gem 'cucumber' | |
gem 'launchy' # So you can do Then show me the page | |
gem 'factory_girl_rails' | |
gem 'shoulda' | |
gem 'faker' | |
gem 'escape_utils' # to fix the warning 'regexp match /.../n against to UTF-8 string' while executing cucumber | |
end | |
$ bundle install | |
To generate cucumber whit spanish steps: | |
ruby script/rails generate cucumber:install es --capybara --testunit | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gemfile | |
gem 'pickle' | |
$ bundle install | |
$ rails g pickle | |
features/suppor/factory_girl.rb | |
require 'factory_girl' | |
Dir[File.dirname(__FILE__) + '/test/factories/*.rb'].each {|file| require file } | |
features/suppor/pickle.rb | |
require 'pickle/world' | |
Pickle.configure do |config| | |
config.adapters = [:factory_girl] | |
config.map 'I', 'myself', 'me', 'my', :to => 'user: "me"' | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gemfile: | |
gem 'formtastic', '~> 1.1.0' | |
gem 'haml-rails' | |
$ bundle install | |
$ rails generate formtastic:install |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* http://github.com/rails/jquery-ujs | |
0. Remove all prototype files from public/javascript | |
1. Download jQuery from docs.jquery.com/Downloading_jQuery and put the file in public/javascripts | |
2. Copy rails.js from github.com/rails/jquery-ujs/raw/master/src/rails.js into public/javascripts - overwriting the prototype one | |
* In the application layout, include: | |
= javascript_include_tag "jquery", "rails", "application" | |
* Rails 3, UJS, and CSRF Meta Tags (http://www.themodestrubyist.com/2010/02/24/rails-3-ujs-and-csrf-meta-tags/) | |
= csrf_meta_tag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://dirk.net/2010/04/17/ruby-debug-with-ruby-19x-and-rails-3-on-rvm/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://github.com/matthooks/authlogic-activation-tutorial | |
http://www.claytonlz.com/index.php/2009/07/authlogic-account-activation-tutorial/ | |
http://edgeguides.rubyonrails.org/action_mailer_basics.html | |
http://github.com/rejeep/authlogic-password-reset-tutorial |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment