
![]() | Ruby on Rails 4 アプリケーションプログラミング 新品価格 |

Railsでwebページ作成でハマった点1
という記事を書いた、その続編
Railsで年収!はい!はい!
そんなわけでRails書いててぼちぼちはまった点
・request.path_info
URLのパス
・gem install therubyracer fails on Mac OS X Lion
http://stackoverflow.com/questions/10905820/gem-install-therubyracer-fails-on-mac-os-x-lion
gem 'therubyracer', '~> 0.11.0beta5'
group :libv8 do
gem 'libv8', "~> 3.11.8"
end
・bootstrapの設定
gem 'less-rails'
gem 'twitter-bootstrap-rails'
gem 'execjs'
した後に、
$ rails g bootstrap:install
http://ubiqlog.com/archives/8749
・ActionView::Template::Error (Your template was not saved as valid UTF-8
ActionView::Template::Error (Your template was not saved as valid UTF-8. Please either specify UTF-8 as the encoding for your template in your text editor, or mark the template with its encoding by inserting the following as the first line of the template:
viewのテンプレートはUTF-8でやらないといけない
・typeの一部にcss当てる
そもそもrailsじゃないけど
以下で一部のtypeにだけ当てられる
http://www.tagindex.com/stylesheet/basic/format4.html
input[type="submit"] {
css
}
・vimmer用のrubyプラグイン
とりあえず以下二つは使えたので使おうと思った
endwise.vim
vim-trailing-whitespace
http://qiita.com/jnchito/items/5141b3b01bced9f7f48f
・webrick
設定できるかもしれないけど、
webrickシングルプロセスっぽい。
なので、httpでwebページへのリクエスト後に自分自身にcurlすると固まる
以下でもう一個起動すれば解決
rails s -p 3001
・railsでクッキー
cookies[:hogehoge] = "aaa"
で保存
・railsでphpのexplode
array.split(',')
・配列で該当の要素を探す
array.index(値)
・ページャー
kaminariっていうライブラリが便利
ほとんどここみれば大丈夫
文字がconfig/locales/ja.ymlに書くってのはポイント
railsはandroidみたいな方法で多言語化できるんだねー
そんなわけでコード書いたら結構はまりましたとさ
もうちょっとでこのプロジェクトも終わる