You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
注意 このエントリは急いで書いたので間違いが含まれている可能性が高いです。気づいた方はご指摘ください。 序文 strong_parameters とは、mass assignment で余計なパラメータをモデルの属性にセットさせないための新しい仕組みです。Rails 4.0 からはこれが標準になります。Rails2.x と 3.x はattr_accessibleやattr_protectedなどで似たような機能が提供されていましたが、これだと管理が煩雑になるケースがありました。 今年の3月くらいにGitHub が mass assignment の脆弱性を突かれたことで 、この問題をどうにかしようという流れが起き、最終的に strong_parameters が作られるという経緯を辿りました。 mass assignment とは Rails ではこんなコードをよく見ると思います。 de
Devise is a flexible authentication solution for Rails based on Warden. It: Is Rack based; Is a complete MVC solution based on Rails engines; Allows you to have multiple models signed in at the same time; Is based on a modularity concept: use only what you really need. It's composed of 10 modules: Database Authenticatable: hashes and stores a password in the database to validate the authenticity o
Download: source codeProject Files in Zip (97.3 KB)mp4Full Size H.264 Video (17.6 MB)m4vSmaller H.264 Video (12.1 MB)webmFull Size VP8 Video (33.4 MB)ogvFull Size Theora Video (23.9 MB) ActionMailer has changed significantly in Rails 3.0. It now has a new API and uses the Mail gem instead of the TMail gem and is much nicer to use. In this episode we’ll show you how to use it to send emails from yo
In the previous blog post I wrote about the first thing that made our blog super fast by using Key-based cache expiration. The second thing I am going to write about is making your Rails app serve assets from S3 and using a CloudFront distribution to serve those files even faster to visitors based on their geographical location. On top of that I made sure to circumvent the "maximum browser connec
ITエンジニア向けの質問・回答コミュニティ「QA@IT」で、「RSpec のテストがたくさんついたオープンソースの Rails3 アプリはあるでしょうか」という質問に対して回答したところ、少しはてブが付いたりしたようです。Railsに限らないかもしれませんが、ちょっとしたサンプルコードや簡易なアプリというのはたくさんあるのですが、そこそこの規模のアプリ、あるいは実運用されているアプリで参考にできるソースコードとなると、意外にパッと思い付かなかったりします。「Railsアプリなら、これを読め」というべきアプリのリストがあればいいのにと、よく思ったりしています。 そんなわけで、いま読むべきだと私が勝手に考えてGitHubのウォッチリストに入れているRails3アプリを、10個ほどリストアップしてみたいと思います(全部で11個ですが)。ほかにオススメなどがあれば、ぜひコチラで情報をお寄せください
ただ、値上げしてだいぶ敷居が高くなってしまったんですよね。プロジェクト3つで$25/monthかかり、しかもエラーが60日で消えてしまいます。 (僕は旧プランのまま$5/monthで使えていますが、これ以上プロジェクトを作れません・・・) そこで、オープンソースのAirbrakeクローン、errbitを使ってみました。 https://github.com/errbit/errbit インストール インストールはREADME通りにやれば簡単です。 Ubuntu 12.04 Server (さくらのVPS)にインストールしました。Rubyはインストール済みです。 # 依存ライブラリインストール(root) apt-get update apt-get install mongodb install libxml2 libxml2-dev libxslt-dev libcurl4-openss
めもめも。 この記事はRubyもRailsもよくわかっていない人が自分のためのメモとしてだらだら書きました。リファレンスがよくわからなかったので、動かして試してみた感じです。 RSpecは(Railsに限らず)Rubyで動くテストフレームワーク。Railsに最初から入ってるTest::Unitよりも色々と良いらしい……けどそっちも使った事がないので比較はできません。 RubyじゃなくてRailsから利用する視点から俺用にまとめます。 環境 $ ruby -v ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux] $ rails -v Rails 3.2.1
Answer (1 of 3): Backbone.js works well with Rails as it was built specifically with Rails in mind. Backbone's MVC architecture provides a level of organization that really seems necessary if your app has a lot of asynchronous page updates.Like Rails it provides a set of conventions to help organ...
FlexやRuby on Railsなどで使い方とかを自分が後でわかるようにメモしておくブログ。最近はFlex系に飽きてます。 RailsでWebアプリケーションを作成していると、当然ですが、フロント側の画面と管理用の画面の二種類ができてきます その際に、フロント側からは当然ですが、管理用の画面を見せたくないという場面が出てくるかと思います その場合、Apache等でIP制限をかけたりするなどの対策が考えられますが、Rails側で次のようにすることもできます 環境 Rails 3.1.1, Ruby 1.9.2 Rails.configurationとroutesを組み合わせた方法 アプリケーションは以下のようになっているとします app/controllers ├── admin │ └── books_controller.rb ├── application_controller
Had been looking at the jsunit and jcoverage demos here (click on coverage report link. Open this in a new tab). I was wondering if any one had done anything similar with Jasmine and JSCoverage ? I'm a little unsure on how to proceed. [EDIT] I am wondering if there is something I can do with a jasmine reporter. My Jasmine "hello world" example makes reference to a TrivialReporter. Maybe this can b
Railsエンジニアになってから1年半くらいが経ち、社内のRailsのプロジェクトを全部で5つくらい触って、今やってるAbilie*1でようやく人並みにテストを書いてる気がしてきたので、現時点でやってるテストの方法をまとめておく。 テストのルール的なの rspecでは必ずモデルのテストは書くようにしてる。ヘルパーも大体書いてるけど、コントローラやルーティングのテストはあまり書いてない。 というのも、コントローラーのコードを極力短くしてモデルを太らせているのでコントローラのテストはあんまり意味が無い気がしていて、その代わりにCapybaraでテストを書いておけば十分なんじゃないかなと思ってきたから。Capybaraは書いてるので、そういう意味では書いてるとも言える。 社内の管理者だけが使える管理画面も作ってるけど、そっちはテストあんまり書いてない。ここは動かなくなっても一般ユーザーには影響が
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く