Displaying 2 results from an estimated 2 matches for "activitiescontroller".
2006 Apr 27
6
Functional Test Problem. Nubee, please help
...he user to be logged in. SO they will be
redirected to my "login" controller.
How do i login first in a functional test? Im assuming i use the setup
method to login the controller.
This is the setup method for the Activities controller functional test:
def setup
@controller = ActivitiesController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
end
my "login" controller has a method "authenticate" which needs
params[:username] and params[:password]. Please help!
Thanks
Allen
--
Posted via http://www.ruby...
2012 Apr 14
7
undefined method `model_name' for NilClass:Class
...blog
tutorial I started with my own data model.
Sadly I am not able to get my create page running.
Model:
class Activity < ActiveRecord::Base
validates :activity, :presence => true
validates :forKids, :presence => true
validates :start_date, :presence => true
end
Controller:
class ActivitiesController < ApplicationController
def index
@activities = Activity.all
respond_to do |format|
format.html # index.html.erb
format.json { render json: @activities }
end
end
end
def new
@activity = Activity.new
respond_to do |format|
format.html # new.html....