Displaying 20 results from an estimated 31 matches for "pagescontrol".
Did you mean:
pagecontrol
2011 Apr 15
7
warning: toplevel constant XYZ referenced Admin:XYZ
I have an odd problem. I got controllers in a namespace and
controllers outside of the namespace. For example, I have a
PagesController and a Admin::PagesController.
When I run rspec from the top, tests pass and I get the following
warning:
spec/controllers/admin/pages_controller_spec.rb:4: warning: toplevel
constant PagesController referenced by Admin::PagesController
This makes no sense. I do have a PagesController and an
A...
2011 Sep 07
3
Method get of ActionController::TestCase ignores routes.rb?
Hi!
I''m running into issue which seems to indicate that
ActionController::TestCase.get() method ignores what I have in routes.rb.
Happens in 3.0.10 and 3.1.0 too.
I have the following RSpec2 test of my XmlRpcController#index action:
it "should get nothing in response to GET request" do
get :index
response.response_code.should == 400 #bad_request
end
And the only line
2007 Nov 02
5
RSpec, RESTful nested routes and :path_prefix
...ller
=>"Wiki::Pages", :path_prefix => "/projects/:project_id/
wiki", :name_prefix => "project_wiki_"
end
But I can''t get RSpec(I''m very new to it) to accept this. It keeps
throwing errors:
ActionController::RoutingError in ''Wiki::PagesController POST
''create'' should be successful''
No route matches {:action=>"create", :controller=>"wiki/
pages", :project_id=>1, :page => {}}
I get why it throws these errors but not how to fix it. The relavant
RSpec:
it "GET ''c...
2014 Apr 04
0
Rspec not running properly
...projects\sample_app> rspec spec
Called from:
C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/actionpack-3.2.0/lib/action_dispatch/middleware/session/abstract_store.rb:28:in
`initialize'.
Rack::File headers parameter replaces cache_control after Rack 1.5.
FFFFFFFFF
Failures:
1) PagesController GET 'about' returns http success
Failure/Error: get 'about'
NoMethodError:
undefined method `get' for
#<RSpec::ExampleGroups::PagesController_2::GETAbout:0x69b85d8>
# ./spec/controllers/pages_controller_spec.rb:39:in `block (3
levels) in <top (r...
2009 Dec 02
14
root_path and root_url undefined
Hi all,
I''ve just started working on another RoR project after a couple of months
away. I''m having trouble with named routes, specifically root_*
In previous apps I''ve used root_path and root_url without any problems, but
in this project (2.3.2 - the same as my last project where I used it) it
comes up undefined.
I''ve double and triple checking my routes.rb,
2011 Jul 13
2
has many relationship
...hange something in this kind of relationship, because it
works great in previous version?
NameError (uninitialized constant User::Post)
class Post < ActiveRecord::Base
belongs_to :user
...
class User < ActiveRecord::Base
has_many :posts
accepts_nested_attributes_for :posts
...
class PagesController < ApplicationController
def index
@user = User.find(6)
@posts = @user.posts #############ERROR
end
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@google...
2006 Jun 19
3
Using set_primary_key breaks acts_as_tree with non-integer column
I just switched from using the standard "id" column into using my own
primary key and generating my own unique id for each record. But, this
breaks acts_as_tree.
Because my new primary key is not an integer, it breaks the SQL query
as follows:
StatementInvalid in PagesController#create
--------------------------------------------------------------------------------------
Mysql::Error: #42S22Unknown column ''1_3'' in ''where clause'': SELECT *
FROM pages WHERE (parent_id = 1_3 AND account_id = 1) ORDER BY
position DESC LIMIT 1
Becaus...
2006 May 10
3
Action Variables Not Available In The View For A Specific Action
I am setting an action variable in my PagesController such as:
def manage
render(:layout => "admin")
@strOut = "STRING Variable Set From The MANAGE Action!"
end
And in the /views/pages/manage.rhtml view, I don?t have access to that
@strOut variable by trying to call it as: <%= @strOut %>
However, I am setting the...
2011 Jun 09
1
subdomain based namespacing makes RSpec incorrectly state that the route doesn't exist
...tes.rb:
scope :admin, :as => ''admin'', :module => ''admin'', :conditions =>
{ :subdomain => ''admin'' } do
resources :pages
end
spec/controllers/admin/pages_controller_spec.rb:
require ''spec_helper''
describe Admin::PagesController do
describe "GET index" do
context "while not signed-in" do
it "should redirect to www.example.com" do
get :index
# also tried get :index, :subdomain => ''admin''
response.should redirect_to(root_url(:subdomain...
2012 Jul 18
3
Undefined method error
I have been working on a project based on Michael Hartl''s book Ruby on
Rails Tutorial in order to try to teach myself Ruby on Rails. However,
when it tries to render a form designed to allow a user to submit a
small message, I get an error saying, "undefined method `model_name'' for
NilClass:Class". It says the error is at line 1, which is "<%= form_for
2008 Sep 24
3
caches_page :if not executing (but caches_action :if) does
...action. (There''s one in the supercontroller but it seems
similarly irrelevant - just trims www. from URLs.)
What am I missing? Did I uncover an :if bug (which I doubt) or am I
misunderstanding?
Full example (also in pastie):
#In this case, the :if is ignored, and all pages cache
class PagesController < ApplicationController
caches_page :show, :if => Proc.new {|c| ["home", "something-
else"].index(c.request.path_parameters["id"])}
before_filter :admin_required, :only =>
[ :index, :new, :create, :delete, :edit, :update ]
before_filter :IP_restricte...
2011 Sep 01
7
couldn't find file 'jquery' rails 3.1 stable mountable engine
...----------------------------
Sprockets::FileNotFound in Coffee/pages#index
couldn''t find file ''jquery''
(in /Webapps/coffee/app/assets/javascripts/coffee/application.js:7)
Started GET "/coffee" for 127.0.0.1 at 2011-09-01 20:49:57 +0200
Processing by Coffee::PagesController#index as HTML
Rendered /Webapps/coffee/app/views/coffee/pages/index.html.erb within
layouts/coffee/application (0.3ms)
Completed 500 Internal Server Error in 41ms
ActionView::Template::Error (couldn''t find file ''jquery''
(in
/Users/jorgen/Webapps/coffee/app/assets/jav...
2010 Apr 14
4
module/class question
Are these two below the same thing?
1. module X
module Y
class Z
2. class X::Y::Z
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
2010 Nov 12
1
Dashboard throwing undefined method `to_time' for nil:NilClass error on page view
...tion starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-11-12 11:51:18] INFO WEBrick 1.3.1
[2010-11-12 11:51:18] INFO ruby 1.8.7 (2010-08-16) [sparc-
solaris2.10]
[2010-11-12 11:51:18] INFO WEBrick::HTTPServer#start: pid=3348
port=3000
Processing PagesController#home (for 192.168.0.20 at 2010-11-12
11:51:54) [GET]
Parameters: {"action"=>"home", "controller"=>"pages"}
NoMethodError (undefined method `to_time'' for nil:NilClass):
app/models/status.rb:7:in `initialize''
app/models/status....
2007 May 15
3
nested blocks
Hello,
Does anyone have an explanation for why the following code results in
the error that follows? I also would value any criticisms of my
approach (i.e., defining it_should_populate_collections). Thanks
-Chris
#Code
def it_should_populate_collections(condition=nil)
it "should populate any necessary collections #{condition}" do
[*@collections_to_populate].each do
2006 Aug 18
0
Impact of inheriting controllers on models
...this:
Application_controller
\
-- AdminArea Controller
--\
----dashboard controller
----user controller
----content controller
----\
------page controller
------placement controller
-- PublicArea Controller
--\
........
At the deepest level the class definition looks like:
class Admin::Content::PagesController < Admin::ContentController
Now, for some reason this has just started to cause problems when trying
to use one of the search plugins available (specifically I have tried
ActiveSearch and Acts_as_ferret). For some reason when trying to trigger
a CRUD action on a model which has acts_as_fer...
2006 Jul 13
3
payment gem, server anomolies
so i have the payment gem working perfectly in our app, running locally
on my system.
uploaded a copy of the app file structure to our server (a rimu rhel3),
but now the payment gem is unresponsive. it throws exceptions with no
error message.
i''m looking for a suggestion how to debug this.
running updated gems and versions on both systems. they seem identical,
unless i''m
2009 May 19
1
[RSpec, Rails] POST create action spec and before_filter
...ils (succesfull save
returns true). Is that intentional? At line 9 you .and_return a
value from a variable you don''t set anywhere. Moreover the "should
set @context" is imo a spec smell (even though it''s in description
string), because it refers to internal state of a PagesController
instance, which you should not be interested in, but the external
behavior.
> The spec "should set @context" works fine. But when running the
> spec "should build a new message" I got this error:
>
> <Page(id: integer, title: string, content: text, created_a...
2007 May 29
0
specs for ActionMailer
...ions.
Rails script/generate mailer produces tests for the email contents
etc. I''ve started by manually converting the generated unit tests to
rspec, and then changing/adding examples as I implement the emails.
In this scenario, an AdminNotify message is sent when a create action
of PagesController class completes.
-----------------
app/models/admin_notify.rb :
class AdminNotify < ActionMailer::Base
def itemcreated(item, sent_at = Time.now)
@subject = ''MySite: itemcreated''
@body = { :item => item }
@recipients = ''admin at gmail...
2009 Jan 26
0
undefined method error for a polymorphic route
Hi, I''m trying to upgrade a 2.0.2 app to 2.2.2, but first I decided to
upgrade to 2.1.2 after reading some posts recommending to do this.
After firing up the app and running my tests, I now see that my
polymorphic routes seem to be broken.
test_should_create_footerpage(PagesControllerTest):
NoMethodError: undefined method `footerpage_url'' for #<PagesController:
0x4814648
>
C:/InstantRails2/rails_apps/real_estate_application_2/vendor/rails/
actionpac
k/lib/action_controller/polymorphic_routes.rb:105:in `send!''
Has anyone run into anything like this...