Displaying 4 results from an estimated 4 matches for "crudcontroller".
2007 Mar 19
3
controller_name with dynamic controllers
I''m writing a controller which should only be inherited from,
something like the generic crud controller seen here: http://
geekonomics.blogspot.com/2006/07/crud-and-shared-controllers.html
Now, in my spec, I would like to create a controller which inherits
from the generic CRUDController, without actually creating the
controller. This controller is *only* for testing.
How can I do this? I can''t do something like this:
Object.const_set("MyCrudController", Class.new(CRUDController))
because the method "controller_name" will complain of setting the...
2007 Mar 24
1
spec''ing metaprograming & rails CRUD
...tml)
This got me thinking about Crud controllers in general. As far as I
know, the generator can''t produce crud classes which are nested
(i.e. /posts/1/comments/7). So I thought about creating my own Crud
class from which to inherit from, with some private methods, like so:
class CrudController < ActiveRecord::Base
class << self
private
def model
# get a default name based on the controller name
# or specify a name
end
def belongs_to
# the model''s "belongs_to"/foreign key relationship
# this could also be found...
2007 Mar 24
0
Using spec fixtures with integration tests
...g about Crud controllers in general. As far as I
> know, the generator can''t produce crud classes which are nested
> (i.e. /posts/1/comments/7). So I thought about creating my own Crud
> class from which to inherit from, with some private methods, like so:
>
> class CrudController < ActiveRecord::Base
> class << self
> private
> def model
> # get a default name based on the controller name
> # or specify a name
> end
>
> def belongs_to
> # the model''s "belongs_to"/foreign key re...
2006 Mar 01
7
Instant Management Frontend with the Scaffolding Extensions Plugin
...to add a
couple new features:
1) Scaffold all models and associations with one command
2) Show all associated objects on the edit page
Example of usage:
In an existing Rails application, create a controller (i.e.
"script/generate controller crud"), and modify so it looks like:
class CrudController < ApplicationController
scaffold_all_models
end
Then go to the index page for the controller (e.g.
http://website/crud). You''ll see a link to a management page for each
of your models. Each management page has links to create, delete,
edit, show, search, and merge pages for the m...