devise unlock解除
def unlock @hoge.unlock_access! end
devise unlock解除
def unlock @hoge.unlock_access! end
save!メソッドは、保存できない場合例外ActiveRecord::RecordInvalidが発生します。
カラム名_changed?でそのカラムが変更されたか分かります。
model.changes {“report”=>[“こんばんわ報告”, “こんばんわ報告更新するよ\r\nどうすんの”]} 変更前と変更後の値が出る
save(:validation => false)はバリデーションをスキップ
.build や build_xxx buildを使うと親モデルに対する外部参照キーを自動でセットできるらしい
起動しないと思ったらただrehashしたら直った、、、、
[git][* fix-iroiro]:~/rails_projects/log/ mailcatcher zsh: command not found: mailcatcher [git][* fix-iroiro]:~/rails_projects/log/ rbenv rehash [git][* fix-iroiro]:~/rails_projects/log/ mailcatcher
titleに表示したいもんを入れればいいっぽ
- readers = set_read_history_contents(reads) %a{href: 'javascript:void(0);', title: "#{readers}", data: {toggle: "tooltip", placement: "top", html: "true"}} #{read_desc}
helperでtitleに入れるもんを設定してみる
def set_read_history_contents(reads) reads.map do |r| content_tag(:div, class:'clearfix') do concat ([content_tag(:small, r.user.name, class:'pull-left'), content_tag(:small, r.read_at.strftime(t('date.formats.long')), class:'pull-right') ].join.html_safe ) end end.join.html_safe end
An error occurred while installing libv8 (3.16.14.7), and Bundler cannot continue.
libv8はjavascript v8の何からしい
bundle config build.libv8 --with-system-v8
こうするとlibv8はインストールできるがtherubyracerでエラー
An error occurred while installing therubyracer (0.12.2), and Bundler cannot continue.
~/.bundle/configの以下を消して
UNDLE_BUILD__NOKOGIRI: "--use-system-libraries" BUNDLE_BUILD__LIBV8: "--with-system-v8"
bundle update libv8
動いたね
bootstarap ファイル選択を少し変えたい時
form { .form-control[type="file"] { border: 0px; box-shadow: none; padding-left: 0; } }
もっと変えたければ↓