0
我的設置:Rails 3.0.9,Ruby 1.9.2爲某些資源操作啓用SSL
我希望只爲項目的創建操作啓用SSL,我該怎麼做?目前我有
resources :projects, :constraints => { :protocol => 'https' }, :only => :create
resources :projects, :except => :create
雖然我不認爲這是正確的。
修訂
因爲我已經把它改爲
match 'projects' => 'projects#create', :constraints => { :protocol => 'https' }, :via => :post
resources :projects, :except => :create
我覺得這是更好,但有尚未這樣做的更好的辦法?
我只是嘗試這樣做,但即使在發展ENV執行HTTPS? – Bob
等一下,有兩個版本https://github.com/retr0h/ssl_requirement和https://github.com/retr0h/ssl_requirement,有什麼區別? – Bob