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) |
to_param [ 1, 'String', true, String].to_param"1/String/true/String"
with_options class ModelName < AR::Base
has_many :model1, dependent: :destroy