我正在使用RSpec-2來測試我的控制器,並且看到奇怪的行爲。 基本上我在Railscasts #71 describe DeliverablesController do
describe "responding to POST create" do
describe "with valid parameters" do
it "should pass the p
我想在rails中實現一個被遺忘的密碼解決方案。我有一個表格供用戶輸入他們註冊帳戶的電子郵件地址,我打算讓郵件程序給他們發送一封唯一的URL,將他們鏈接到密碼重置頁面。 我的config/routes.rb中文件有以下途徑: resources :users do
collection do
get :lost_password #the account-email submi
,我有以下嵌套的資源在我routes.rb文件 我的模型: class Issuer < ActiveRecord::Base
has_many :certificates
end
class Certificate < ActiveRecord::Base
belongs_to :issuer
end
我得到當我訪問以下錯誤:/issuer/2/certif
對於我目前的路由,在軌道上的代碼如下紅寶石: <%= link_to current_user.name, users_path(current_user) %>
產生一個鏈接像下面這樣: <a href="/users.1">name</a>
反過來,Ruby on Rails的有一個很難理解這個,因爲它預計1是格式: ActiveRecord::RecordNotFound in Us