Displaying 2 results from an estimated 2 matches for "authenticate_admin".
2013 Mar 20
2
Rspec + Devise + BaseController
...r the admin section of a project. All
controllers whitin the admin section will inherit from it.
#####################################################
#app/controllers/admins/base_controller.rb
class Admins::BaseController < ApplicationController
layout "admin_cms"
before_filter :authenticate_admin!
end
#####################################################
#spec/controllers/admins/base_controller_spec.rb
require ''spec_helper''
describe Admins::BaseController do
controller do
def index
end
end
describe "before_filter#authenticate_admin!" do
bef...
2012 Aug 25
0
accepts_nested_attributes_for and fields_for not working!
...rs
respectively) as pdfs to amazon s3 and viewing them as iframes. When I try
to save a menu object, the menu object gets created and saved, but its
brunch, lunch and dinner don''t get created when I edit it. When i run
Brunch.all i get []
Thanks!
Sarah
Menu Controller:
before_filter :authenticate_admin!, :except => [:show]
def edit
@menu = Menu.find(params[:id])
@menu.dinners.build
@menu.lunches.build
@menu.brunches.build
end
Menu Model:
class Menu < ActiveRecord::Base
has_many :brunches, :dependent => :destroy
has_many :lunches, :dependent => :destroy
has_...