Displaying 6 results from an estimated 6 matches for "projectcontrol".
2008 Mar 08
7
ridding away with do_request
I''m heading out of town, but had a quick thought I wanted to share.
Rather then using ambiguous named request helpers in controller specs
like "do_request", I''ve been using more readable helpers like
"post_create".
For example...
describe ProjectController do
def post_create
post :create, ...
end
before do
end
it "creates a new project" do
Project.should_receive(:create).with(....)
post_create
end
end
IMO is adds a little more readability when looking at an individual
"it" behavior on a controller s...
2006 Apr 23
5
Controllers in folders and helper scope in Rails >1.0
...min and for
users, so it looks like this:
/app/controllers/admin/project_controller.rb
/app/controllers/admin/...
/app/controllers/project_controller.rb
/app/controllers/...
The controller-classes are properly scoped like this:
/app/controllers/admin/project_controller.rb has:
class Admin::ProjectController < ApplicationController
layout "admin"
def index
...
end
/app/controllers/project_controller.rb has:
class ProjectController < ApplicationController
layout "user"
def index
...
end
Those controllers make use of helpers, and again, t...
2006 Mar 12
1
a better way to alias methods
Hi is there a better way to accomplish this task?
class PortfolioController < ProjectController
layout ''portfolio''
def boing
redirect_to :action=>:index
end
alias_method :new , :boing
alias_method :destroy , :boing
alias_method :edit , :boing
alias_method :update , :boing
end
My portfolio controller implements view on...
2009 Sep 09
1
Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch Going Nuts!
Hi,
I have been trying to do this for a few days now and cannot figure it out. I
would be very grateful is anyone can help me
I am trying to upload an attachment to AWS, S3 using paperclip,
however every time I keep getting this error:
ActiveRecord::AssociationTypeMismatch in ProjectController#create_notice
Graphic(#37649720) expected, got Tempfile(#27280470)
RAILS_ROOT: C:/devlopment_tools/projects/codex1/active/bugtrigger
Application Trace | Framework Trace | Full Trace
c:/devlopment_tools/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/lib/active_record/associations/association_p...
2009 Sep 10
2
Paperclip attachment to AWS - ActiveRecord::AssociationTypeMismatch
Hi,
I have been trying to do this for a few days now and cannot figure it
out. I would be very grateful is anyone can help me
I am trying to upload an attachment to AWS, S3 using paperclip,
however every time I keep getting this error:
ActiveRecord::AssociationTypeMismatch in
ProjectController#create_notice
Graphic(#37649720) expected, got Tempfile(#27280470)
RAILS_ROOT: C:/devlopment_tools/projects/codex1/active/bugtrigger
Application Trace | Framework Trace | Full Trace
c:/devlopment_tools/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.3/
lib/
active_record/associations/association...
2006 Jul 26
0
Using validators for appending to a HABTM association
class User < ActiveRecord::Base
has_and_belongs_to_many :projects
end
class Project < ActiveRecord::Base
has_and_belongs_to_many :users
end
class ProjectController < ApplicationController
def add_user
@project = Project.find(params[:project_id])
@user = User.find(params[:id])
@project.users << @user unless @project.users.include?(@user)
# I''d honestly rather do the above with a validator instead of a condition
# This...