- Learn authetication
- Learn rake tasks
- Learn Testing
- Learn APIS
- Learn popular gems
- Learn about how to scale Ruby On Rails application
- Realtime chatting
- Frontend frameworks with Rails
string: { name: "varchar", limit: 255 },
text: { name: "text", limit: 65535 },
integer: { name: "int", limit: 4 },
float: { name: "float" },
decimal: { name: "decimal" },
datetime: { name: "datetime" },
timestamp: { name: "timestamp" },
time: { name: "time" },
date: { name: "date" },
binary: { name: "blob", limit: 65535 },
boolean: { name: "tinyint", limit: 1 },
json: { name: "json" },
Inside routes namespace, controller outside namespace
resources :proposals, controller: '/proposals' do
end
- Device and Social authetication, Tutorial
unless column_exists? :projects, :published_at
add_column :projects, :published_at, :datetime, default:Time.now,null:true
else
change_column :projects, :published_at, :datetime
end
# def down
# change_column :projects, :budget, 'integer USING CAST(budget AS integer)'
# end
&.
: Safe Navigation
def serializable_hash(options = nil)
super(options).merge(encrypted_password: encrypted_password, reset_password_token: reset_password_token) # you can keep adding attributes here that you wish to expose
end
params = ActionController::Parameters.new(user: { name: 'Francesco', age: 22, role: 'admin' })
permitted = params.require(:user).permit(:name, :age)
# config/environment/production.rb
config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
config.assets.precompile += %w( .svg .eot .woff .woff2 .ttf )
class Comment < ActiveRecord::Base
belongs_to :student
belongs_to :commenter, class_name: 'Student'
end
- multiple namespace form fields, fields_for
<%= fields_for :permission, @person.permission do |permission_fields| %>
Admin? : <%= permission_fields.check_box :admin %>
<% end %>
format.js { render :js => "window.location.reload()"} // Reload Current url