更新: | 2014-05-14 |
---|---|
バージョン: | 0.0.12 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
とても詳しいまとめがありますので、ますはそちらを見ることをオススメします。
更新: | 2014-05-14 |
---|---|
バージョン: | 0.0.12 |
作者: | @voluntas |
URL: | http://voluntas.github.io/ |
とても詳しいまとめがありますので、ますはそちらを見ることをオススメします。
# app/controllers/users/password_controller.rb | |
class Users::PasswordsController < Devise::PasswordsController | |
def resource_params | |
params.require(:user).permit(:email, :password, :password_confirmation) | |
end | |
private :resource_params | |
end |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
source "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
For a while, I have felt that the following is the correct way to improve the mass assignment problem without increasing the burden on new users. Now that the problem with the Rails default has been brought up again, it's a good time to revisit it.
When creating a form with form_for
, include a signed token including all of the fields that were created at form creation time. Only these fields are allowed.
To allow new known fields to be added via JS, we could add:
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
Some exercises from the Falsy Values workshops.
The good parts:
=Navigating= | |
visit('/projects') | |
visit(post_comments_path(post)) | |
=Clicking links and buttons= | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') | |
click('Link Text') # Click either a link or a button | |
click('Button Value') |