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
2
votes
1 answer
will_paginate and inherited_resources don't work together
Will paginate (3.0.3) doesn't work with inherited resources (1.3.1). In my controller:
protected
def collection
@posts ||= end_of_association_chain.paginate(:page => params[:page])
end
I added require 'will_paginate/array' in my initializer, but…

Artem Korneev
- 167
- 7
1
vote
0 answers
inherit to admin controller, with Admin_interface, inherited_resources and Rails 3
I need a backend for administration, I tried RailsAdmin and ActiveAdmin, but the limited level of customization and found the gem admin_interface which gave me the options I wanted.
This is the structure of my project
├── app
│ ├── assets
│ ├──…

Benito Anagua
- 11
- 4
1
vote
1 answer
Inherited_resources custom errors
I have model with virtual attributes, for use in simple_form:
class Sms < ActiveRecord::Base
attr_accessor :delayed_send, :send_time_date, :send_time_time
I have form for /smses/new:
= simple_form_for([:admin, resource]) do |f|
...
.clear
…

BazZy
- 2,429
- 3
- 21
- 26
1
vote
1 answer
Rails 3 inherited_resources ignores 'defaults' setting
I'm using Inherited resources for my controllers. And now i have model:
class Sms < ActiveRecord::Base
end
And i want controller for it, where i make defaults:
class Admin::SmsesController < Admin::InheritedResources
defaults :resource_class =>…

BazZy
- 2,429
- 3
- 21
- 26
1
vote
1 answer
InheritedResources/CanCan issue
CanCan behaves really strange with index action in controller while using InheritedResouces. If i have
can :read, Question do |question|
false
end
in ability.rb - it grants access to the action despite on block's returning value. If i remove this…

tipugin
- 259
- 1
- 3
- 11
1
vote
0 answers
Using belongs_to in both Parent Controller and Child Controller does not work
I have a a scenario where I had to use belongs_to association in a Parent Controller as well as Child Controller. In this scenario, the helpers like collection_url are generating wrong and I get undefined method....
Below is my scenario..
class…

Karthik Krishnan
- 56
- 3
1
vote
1 answer
custom actions for inherited_resources
I have 3 custom actions for my controller and was hoping that each of these use the resource object that inherited_resources gives us. So basically, instead of:
def cancel
@job = resource.cancel!
end
def restart
@job =…

corroded
- 21,406
- 19
- 83
- 132
1
vote
1 answer
Wrong model stub when testing controllers which using inherited_resources
I'm new to RSpec and my controllers're using inherited_resources, I have this mock/stub setup like:
describe MarketsController do
def mock_market(stubs={})
@mock_market ||= mock_model(Market, stubs).as_null_object
end
describe "GET index"…

Tyrael Tong
- 751
- 10
- 21
1
vote
1 answer
inherited_resources and multiple belongs_to without nesting
Let's get down to brass tacks.
Rails: 2.3.11
I have a controller using inherited_resources to reference two separate and non-nested resources.
My controller is as shown:
class Tools::DeploymentLinesController < ToolsController
inherit_resources
…

CITguy
- 11
- 2
1
vote
0 answers
Rails 3 getting wrong mocked models with Rspec, Nested Resources and inherited_resources
I'm trying to test a nested controller with Rspec and mocked models but i'm getting these errors:
Failure/Error: it { assigns[:store].should equal(mock_store) }
expected # => #
got…

space_monk
- 11
- 3
1
vote
3 answers
Running actions after successful create or update actions on InheritedResources
I'm currently developing a couple of modules to reuse code from my controllers on a Rails 3 using InheritedResources (last version) app.
My idea is to have some behavior that should be run after a successful create or update of the resource but,…

Alessandra Pereyra
- 2,640
- 18
- 22
1
vote
1 answer
Caching with inherited_resources
I have build an application using inherited_resource plugin and its ready to go into production.
Now I am looking at ways to implement caching for the same application. As I have some fragments of the page which are dependent on the current_user I…

Aj Gu
- 1,509
- 9
- 12
1
vote
0 answers
Extending view paths
i've got controllers/admin/base_controller.rb where defined all similar actions (with help of inherited_resources gem) for other admin controllers (they are called like class Admin::EventsController < Admin::BaseController) and i'm almost happy -…

nir0
- 529
- 4
- 7
1
vote
1 answer
Formtastic checkboxes not getting checked when editing resource, when using MongoMapper
With the following Store and Service models, managed with MongoMapper:
class Store
include MongoMapper::Document
key :service_ids, Array, :typecast => 'ObjectId'
many :services, :in => :service_ids
end
class Service
include…

oliverbarnes
- 2,111
- 1
- 20
- 31
1
vote
0 answers
`method_missing': undefined method `generators' for #
I'm getting undefined method error when i try to run rails s command from my linux terminal. i don't have inherited_resources gem in my gemfile.
I understand that such question has been answered already but this is not so in my case. i don't have…