RSpec controller for nested resources, before_action
问题 Let say I have setup like this: config/routes.rb resources :graves do resources :candles end app/models/grave.rb has_many :candles, dependent: :destroy app/models/candles.rb belongs_to :grave app/controllers/candles_controller.rb before_action :get_grave def create @candle = @grave.candles.new(candle_params) respond_to do |format| if @candle.save format.html { redirect_to @grave, notice: 'Candle was successfully created.' } format.json { } else format.html { render :new } format.json { render