Inherited Resources speeds up development by making your controllers inherit all restful actions so you just have to focus on what is important.
Questions tagged [inherited-resources]
99 questions
1
vote
0 answers
File upload using CarrierWave, SimpleForm, InheritedResources and polymorphic associations
I am having trouble getting nested attributes to work with file uploads using polymorphism. Here is the relevant sourcecde from my app.
app/uploaders/image_uploader.rb
# encoding: utf-8
class ImageUploader < CarrierWave::Uploader::Base
include…

scarver2
- 7,887
- 2
- 53
- 61
1
vote
1 answer
Inherited Resources and Draper
How to use Draper with Inherited Resources?
In other words, how to call the method(#decorate) for each resource? For example @posts for #index, @post for #show?
I thought about default_scope, but everything related with Draper needs to be in the…

just so
- 1,088
- 2
- 11
- 23
0
votes
1 answer
inherited resource belongs_to & polymorphic troubles
So I am having trouble figuring out what is going on with a polymorphic assoc/inherited resources, and the documentation is confusing me as I don't know exactly what part of it means -- in the documentation it states:
Right now, Inherited Resources…

thrice801
- 1,671
- 5
- 23
- 31
0
votes
1 answer
Cancan abilities for inherited resources with nesting in controller
I have inherited resources working in my controllers and I use cancan for authorization. However, I have a problem writing required abilities.
I can display particular order in 2 ways:
/profile/123/orders/321
/store/456/orders/321
in…

Przemek Maczewski
- 211
- 2
- 13
0
votes
1 answer
authorize my rails 3 applicationd
I'm developing a rails 3 application using inherited_resources and devise.
I tried to use cancan as my authorization plugin and it wasn't enough (i need more complex conditions for my authorization rules).
I also tried using…

refaelos
- 7,927
- 7
- 36
- 55
0
votes
1 answer
inherited_resources - best practices for missing parent model
Maybe you have seen/read the Railscast/Asciicast about subdomains in Rails 3. I'd like you to ask about best practices on how to implement an application behavior when the parent (in this article: "blog") is not found. Let me…

Alexey Poimtsev
- 2,845
- 3
- 35
- 63
0
votes
1 answer
Site-wide Inherited Resources behavior Rails 3
I'm trying to develop some conventions behind our controller responses. One of my conventions is:
On successful create, if the request is XHR, render @the_object
I can't see anything that allows me to do this across the board. Currently I'm…

brad
- 31,987
- 28
- 102
- 155
0
votes
2 answers
a template declaration cannot appear at block scope (template class in main)
here is my code:
#include
using namespace std;
template
class List
{
public:
List(T);
};
template
class A: public List
{
public:
};
int main()
{ //my problem is here...!
A a(10);
}
I don't…
0
votes
2 answers
inherited resources: routes with nested resources
In my routes.rb I have:
resources :fire_preventions do
get 'search_adv', :on => :collection
end
How can I use it with inherited resources routes?
search_adv_collection_url doesn't work.

Mauro
- 1
- 1
0
votes
0 answers
Rails ActiveAdmin routing problem at index page with renamed resource
I have an index page:
ActiveAdmin.register Activity do
config.sort_order = ''
belongs_to :specialist, optional: true
belongs_to :activities_category, optional: true
end
And I have another index page for the same but renamed…
0
votes
0 answers
Rails - Inherited Resource - missing template in one environment only
Question as above - I'm trying to create a new booking which happens fine in development, however the same code on the staging server gives me:
ActionView::MissingTemplatebooking_system/bookings#new
Missing template booking_system/bookings/new,…

Mark
- 6,112
- 4
- 21
- 46
0
votes
1 answer
Using inherited_resources for nested, polymorphic comments
I am new to using inherited resources and want to use it for
polymorphic nested comments. I have several objects that will be
commentable (articles, galleries, etc.) and comments can also be
nested. I'm using a combination of awesome_nested_set…

Eric M.
- 5,399
- 6
- 41
- 67
0
votes
1 answer
inherited_resources - go to parent
i have 2 inherited resources (with plugin of Jose Valim) - Blogs and Posts. Of course - Blog hm Posts and Post bt Blog. Routes is simply enough
resources :blogs, :only => [:show] do
resources :posts
end
Also i have updated action…

Alexey Poimtsev
- 2,845
- 3
- 35
- 63
0
votes
0 answers
ActiveAdmin menu reloading
We've a music festival admin that works like a hub for different cities.
For example, .com/usa/en/admin/ should present the admin for USA festival edition. And .com/madrid/es/admin should present the admin for Spain edition.
The pattern is…

Theo B
- 351
- 1
- 3
- 12
0
votes
1 answer
inherited_resources and cancan conflict
There are conflict with inherited_resources and Ryan Bates's cancan gem.
I have some simple controller
class IssuesController < InheritedResources::Base
respond_to :html
load_and_authorize_resource
def tag
@issues =…

Alexey Poimtsev
- 2,845
- 3
- 35
- 63