Displaying 20 results from an estimated 100000 matches similar to: "Namespaces that are controllers?"
2006 Nov 04
0
Controllers and Namespaces (no problem, just questions)
I''m a little late on finding this article:
http://habtm.com/articles/2006/07/01/if-your-models-arent-namespaced-why-should-your-controllers-be-or-how-i-learned-to-stop-worrying-and-love-the-crud
This idea does not sit well with me and am curious as to the Rails roadmap.
I''ve seen a couple things demonstrated in examples (Rails Book, api) that
later turn to become deprecated. As
2012 Mar 02
0
ConnectionNotEstablished when using connection on AR::Base abstract subclass
I''m using AR outside of Rails and calling establish_connection on an
ActiveRecord::Base abstract_class subclass (to protect my connection
in case anyone else is using AR). It was working just fine with AR
3.0.9, but I recently attempted to upgrade to AR 3.2.2. Now, when I
hit a "nested" query from a has_many, I get a
ActiveRecord::ConnectionNotEstablished. If I call
2011 Jul 25
3
Rails 3.1 Engines: Full vs. Mountable
Hi all,
I was hoping someone could please clarify the differences between a
full engine and a mountable one.
I have noticed the following:
** Full Engine **
- With a full engine, the parent application inherits the routes from
the engine. It is not necessary to specify anything in parent_app/
config/routes.rb. Specifying the gem in Gemfile is enough. The
engine routes are specified as:
#
2011 Jun 06
0
quick question: are errors best checked on controllers by stubbing save/update_attributes?
Hi,
Is it best to simulate errors in functional testing by stubbing the
controller save/update_attributes to return false? Will I miss
anything important if I always test controller behavior in the case of
errors in this way?
Thanks,
Lille
--
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
2010 Apr 18
0
Rails 3: new namespace inside nested resource?
Hi,
Is there a way to use namespaces inside nested resources? For example,
I have:
resources :users do
resources :tags
end
and I''d like to place the tags controller inside controllers/users,
with the equivalent for templates.
If I try this:
resources :users do
namespace :users do
resources :tags
end
end
I''ll get redundant route names:
users_user_tags,
2010 Jan 20
0
How to map a Named Route onto a namespaced resource?
I have a site, where I am currently adding a self-built shop.
Among other stuff I have this construction in my route-file
map.namespace :shop do |shop|
shop.resources :categories do |categories|
categories.resources :products
end
end
I like the namespace, since it encapsulates the shop nicely inside my
webapplication.
Somehow I would like the url "http://mysite.com/shop" to
2010 Feb 25
1
accepts_nested_attributes_for vs. multiple controllers on one page
Hi,
I''d like to render the results from show, create, edit and delete
actions for several different models (one controller per model) on one
page.
While these several models are conceptually related, they do not need
to be associated with each other. So, I''d rather not impose
associations on them just to use accepts_nested_attributes_for to
facilitate their presentation in a
2010 Aug 15
0
Singular resources namespaced by its slug (Routing)
Hi,
I have the followed Rails 3 routes:
Hello::Application.routes.draw do
resources :blogs do
resources :articles do
resources :comments
end
end
end
By raking them, we can find (for instance):
GET /blogs/:blog_id/articles(.:format) {:action=>"index",
:controller=>"articles"}
Because every routes begin with the
2009 Dec 30
2
relating controllers... How to?
Hi, anyone can help me?
I have 2 model : Error and Error Detail
Error: Error_name, tot_errors
Error Detail: Error_name , details for error
e.g.
Error = Error_type1 | 5
Error Detail = 5 lines with Error_name=Error_type1
I want to show this:
---------------------------------------------------------------------
Error_type1 | 5 | Show Error Detail Link
2011 Jul 14
1
RoutingError with RSpec Controller test on Scoped Route
So I have a route that looks like this:
scope "4" do
scope "public" do
scope ":apikey" do
resources :shops
end
end
end
And a bunch of controller specs, an example of which looks like this:
describe ShopsController do
describe "when responding to a GET" do
context "#new" do
it "should create a new instance
2010 Sep 08
0
Re: Call expire_fragment from outside sweepers or controllers
xponrails wrote:
> Hi all.
>
> I need to expire cached fragments from outside sweepers or
> controllers: I have a rake task that calls a method inside a module in
> the /lib directory. This task will be called at a scheduled time by a
> crontab job.
>
> After method execution I would like to expire some cached fragments.
>
> I''ve just tried to import
2012 Apr 14
2
How to implement sory-by links?
Hello people.
I have an app which lists Offers from different Vendors.
I want to implement "sort by" links and I''ll do this using scopes in my
Offer model. But how should I implement the functionality in the
controllers/router? Should I use a member route along with a new controller
action (eg. "expiring", or "most_expensive") or just use param queries?
2011 Sep 04
2
has_many :through basic fubar
I''m trying to do, what seems like, a very basic join. However, the
association just doesn''t seem to work. I''m sure it''s something very
simple but I don''t know what.
class Role < ActiveRecord::Base
belongs_to :packages
belongs_to :users
end
class Package < ActiveRecord::Base
has_many :roles
has_many :users, :through => :roles
end
2012 Jan 18
2
Polymorphic and standard association issue
Hello all,
I''m having a strange issue with a model that belongs_to two other
models. The one association is polymorphic and the other is normal.
================================
class Role < ActiveRecord::Base
belongs_to :user
belongs_to :permission, :polymorphic => true
end
class User < ActiveRecord::Base
has_many :roles
has_many :programs, :through => :roles
end
2011 Jul 28
2
rails 3 routing error
Here''s the error:
1) SessionsController GET ''new'' should be successful
Failure/Error: get :new
ActionController::RoutingError:
No route matches {:controller=>"sessions", :action=>"new"}
# ./spec/controllers/sessions_controller_spec.rb:8:in `block (3
levels) in <top (required)>''
2) SessionsController GET
2012 Jul 26
2
Develop resources within namespace
Hi,
I want to develop my resources that deal with CRUD operations on my models in a namespace of /admin. How is the best approach to do this? What needs to be changed in order to do this? As in my last attempt of moving things to a namespace my software broke.
TIA,
Dean
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2010 Mar 23
1
:has_many and :controller specified in routes.rb
Have an app using older version of Rails (2.3.2) that I need some
routing assistance with if anyone has a minute.
The app was originally designed to be purely html view, and an xml and
json api was hacked on. To keep it clean, we are now moving the first
version of the api (v1) under its own directory (v1) under app/
controllers but still responding to the old paths.
One of the parts of the new
2010 Jun 03
2
creating fixtures for has_many :through
I''m stymied at how to create a fixture that establishes a has_many
:through relationship.
I''ve watched the railscast at:
http://media.railscasts.com/videos/081_fixtures_in_rails_2.mov
... but that''s for HABTM relationships. I''ve read:
http://www.ruby-forum.com/topic/145676
but that ultimately doesn''t answer any question. So with no further
ado:
2006 Nov 04
0
Namespacing controllers
Sorry for the dup, but didn''t get a response with the first one, so I
cleaned it up a bit in hopes of getting a response.
There has been a couple of blogs (one posted at
weblog.rubyonrails.com"Things you shouldn''t do in Rails") that are
stating namespacing controllers
are bad and that you should avoid using them.
This idea does not sit well with me and am curious as
2010 Oct 14
2
Nested form, perhaps?
I have a general design question, and haven''t written any code for
this feature yet. I''m setting up a control panel for a sort of team/
content management system. A new project needs a team to work on it.
The project has been saved, so we don''t have to worry about that. But
each member of the team needs to have a role in relation to this
project (they may have