to_param
[ 1, 'String', true, String].to_param"1/String/true/String"
with_options
class ModelName < AR::Base
has_many :model1, dependent: :destroy| class User < ApplicationRecord | |
| has_many :posts | |
| has_many :comments | |
| # id :integer not null, primary key | |
| # name :string(50) default("") | |
| end |
| #Model | |
| @user.should have(1).error_on(:username) # Checks whether there is an error in username | |
| @user.errors[:username].should include("can't be blank") # check for the error message | |
| #Rendering | |
| response.should render_template(:index) | |
| #Redirecting | |
| response.should redirect_to(movies_path) |
| # Load DSL and Setup Up Stages | |
| require 'capistrano/setup' | |
| # Includes default deployment tasks | |
| require 'capistrano/deploy' | |
| require 'capistrano/rails' | |
| require 'rvm1/capistrano3' | |
| # Loads custom tasks from `lib/capistrano/tasks' if you have any defined. |
| export GIT_MERGE_AUTOEDIT='no' | |
| alias rdm='rake db:migrate' | |
| alias migratefortests='bin/rails db:migrate RAILS_ENV=test' | |
| # Utils | |
| alias comcount='git shortlog -sn | grep -i arindam | cut -f 1 | paste -sd+ - | bc' | |
| alias reload='source ~/.bash_profile' | |
| alias editp='vim ~/.bash_profile' | |
| alias gemcount='gem list | wc -l' |
to_param [ 1, 'String', true, String].to_param"1/String/true/String"
with_options class ModelName < AR::Base
has_many :model1, dependent: :destroyA Pen by Arindam Chakraborty on CodePen.
| @keyframes spin{ | |
| 0% { transform:rotate(0) scale(1) } | |
| 25% { transform:rotate(360deg) scale(.9) } | |
| 50% { transform:rotate(720deg) scale(.8) } | |
| 75% { transform:rotate(720deg) scale(.9) } | |
| 100% { transform:rotate(720deg) scale(1) } | |
| } | |
| @-moz-keyframes spin { | |
| 0% { -moz-transform:rotate(0) scale(1) } | |
| 25% { -moz-transform:rotate(360deg) scale(.9) } |
| source 'https://rubygems.org' | |
| source 'http://gems.github.com' | |
| gem "bcrypt-ruby", :require => "bcrypt" | |
| gem "cached_model", '1.3.1' | |
| gem "capistrano", '2.15.4' | |
| gem "daemons", '1.1.9' | |
| gem 'debugger', '1.6.0' | |
| gem 'delayed_job_active_record', '0.4.4' | |
| gem 'hiredis', '0.4.5' |
| diff --git a/Gemfile b/Gemfile | |
| index df36647..2b8cb10 100644 | |
| --- a/Gemfile | |
| +++ b/Gemfile | |
| @@ -19,6 +19,9 @@ gem "rmagick", '2.13.1' | |
| gem 'rvm-capistrano' | |
| gem 'hiredis', '0.4.5' | |
| gem 'redis', '3.0.2' | |
| +gem 'activeadmin' | |
| + gem 'sass-rails' |
| Started GET "/admin" for 127.0.0.1 at 2013-02-26 00:48:33 +0530 | |
| ActionController::RoutingError (wrong constant name Admin/dashboardController): | |
| activesupport (3.2.6) lib/active_support/inflector/methods.rb:229:in `const_defined?' | |
| activesupport (3.2.6) lib/active_support/inflector/methods.rb:229:in `block in constantize' | |
| activesupport (3.2.6) lib/active_support/inflector/methods.rb:228:in `each' | |
| activesupport (3.2.6) lib/active_support/inflector/methods.rb:228:in `constantize' | |
| activesupport (3.2.6) lib/active_support/dependencies.rb:554:in `get' | |
| actionpack (3.2.6) lib/action_dispatch/routing/route_set.rb:69:in `controller_reference' | |
| actionpack (3.2.6) lib/action_dispatch/routing/route_set.rb:54:in `controller' |