similar to: Another generic CRUD controller

Displaying 20 results from an estimated 400 matches similar to: "Another generic CRUD controller"

2009 Feb 20
6
How to mock an object defined in the before_filter function?
Hello, I am trying to implement the following scenario, but I am stuck ... The thing is I want to initialize a variable @comment when the stub function "find_comment" is called. The way I do it below doesn''t work, since "before_filter :find_comment" returns true/false and @comment initialization is done inside it. Could you please give me a hint how to do it? One
2006 Jul 02
11
Rails Plugin: meantime_filter for controllers (actions within blocks)
Hello, I just finished writing a plugin for Rails that I''m annoucing the first release here: meantime_filter. It is descibed at http://roman2k.free.fr/rails/meantime_filter/0.1.0/ rdoc/ (See the end of this message for getting it.) ABOUT THE PLUGIN It extends ActionController to add the functionnality of having filters run at the action call time. This new type of filter yields
2006 Jul 24
1
meantime_filter won''t pick up my missing methods
<code><pre> module Scope protected def method_missing(method_id, *arguments, &block) if method_id.id2name =~ /^scope_([_a-z]\w*)_to_([_a-z]\w*)/ scope_model($1.singularize.capitalize, "#{$2}_id", &block) else super end end def scope_model(klass, foreign_key, &block) eval(klass).with_scope({ :find =>
2007 Mar 24
1
spec''ing metaprograming & rails CRUD
For edge rails there is a Crud generator. There is also a CRUD controller that is out there from which you can inherit your other controllers (see http://geekonomics.blogspot.com/2006/07/crud-and- shared-controllers.html) 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.
2006 Aug 03
6
Listing all of a nested Resources
I''ll use the example on the Rails blog. map.resources :posts do |posts| posts.resources :comments, :trackbacks end Now comments are at /posts/:post_id/comments. Okay but what if I want to list all the comments for all the posts. It should be at /comments, but that isn''t map that way. Can I map comments twice? -- Posted via http://www.ruby-forum.com/.
2006 Oct 31
0
6312173 The libsldap function __ns_ldap_list() returns invaild DN string when using attributMap
Author: sdussud Repository: /hg/zfs-crypto/gate Revision: da727245bf8a0e3cdabe620c5abcf05e3f55e70a Log message: 6312173 The libsldap function __ns_ldap_list() returns invaild DN string when using attributMap Files: update: usr/src/lib/libsldap/common/ns_reads.c update: usr/src/lib/libsldap/common/ns_sldap.h
2005 Nov 02
2
double posts
Is any one else getting double posts from this list ? -- -- Chris L. Franklin -- ________________________________________________________________________ This email was scanned by the server at NomadCF.com, And has been deemed clean of invaild and or dangerous email attachment type and virus'. Although this is by no means a guarantee.
2007 Aug 23
1
validation across controllers
Hello, here is my issue with an exemple! Typical example: post and comments in REST design ------------------------------------------------------------------------------------------------------------------------------------- class PostsController < ApplicationController ... def show ... @comments = @post.comments.find(:all, :order...blabla) end ... end
2009 Aug 16
5
any help with captcha in my comments ?
this is my error: Processing ApplicationController#create (for 127.0.0.1 at 2009-08-17 00:57:56) [POST] Parameters: {"comment"=>{"name"=>"asdasd", "body"=>"asdasd"}, "commit"=>"Add Comment", "post_id"=>"19",
2006 Aug 11
2
Shouldn''t CRUD be CRUDS?
With most models, almost always I find myself writing Search/Find actions. When I view a Listing of a model, I want to look at another record or set of records. How nice it would be if I can do a query-by-example while viewing a Listing, or during Show/Edit/Create. Would be nice if Search becomes another act in the scaffolding magic. This wish has been expressed here before. Since then, has
2010 Sep 01
5
validation errors bring up stack trace error page
hello! I made some custom validations for my app, which do catch invalid data in the console. However, when I enter invalid data through a form on the browser view, I get your stack trace error style page (similar to what you see when you get a syntax error or a nil object) instead of the nicely styled error messages (what you would see in a scaffolded application. First off, what is the stack
2006 Aug 02
1
Use Non CRUD with Simply RESTful
Hey guys, I''m trying out the new RESTful bits in Edge Rails, and am having a bit of trouble wrapping my brain around certain things. For instance, say I have a page that is separated into sections with tabs at the top. I want to replace divs on the page with RJS. Now typically before I''d have a method on the controller that rendered an RJS template to accomplish this.
2006 Aug 14
1
Testing CRUD/Rest Controllers
I have a few simple controllers doing plain, simple crud in a standard way. now it''s not very DRY to write a funtcional test for each controller, since they are all doing the same (apart from a few variable names, but that could be easily inflected or so). is there a way to do this? e.g. does inheritance work with tests, so i define a base test first, inherit my other tests and add a few
2006 Nov 04
0
How do CRUD and REST work for a wizard-style application?
I''m rewriting an application with the intention to use the elegant CRUD and REST design principles as outlined by DHH in his RailsConf Keynote[1]. The question is: how do you use those principles for an application that is of a sequential nature? The application works much like an MS Windows wizard: user begins at screen foo. After doing (or not) some stuff in screen foo, he is taken to
2006 Jul 20
1
Model CRUD via web services
Hello, I was wondering if there was any automated (may be scaffolding) way of exposing Model CRUD via web services. I found this ticket for django, but nothing for Rails. http://code.djangoproject.com/ticket/115 Thanks in advance for your opinions and suggestions. Regards. -- Surendra Singhi http://ssinghi.kreeti.com, http://www.kreeti.com Read my blog at:
2006 Jul 25
1
how to enable a ruby on rails app for multi-row CRUD
Every row in the grid, has a checkbox ahead. pepole can select multi-row through these checkboxes, and then press a [delete] button to delete all the selected rows in a single action. how can i do this? -- Posted via http://www.ruby-forum.com/.
2006 Jul 27
0
CRUD, REST and associations
Let''s say I have the model class Reader and Magazine, connected by join model Subscription. It looks something like this class Reader < ActiveRecord::Base has_many :subscriptions, :dependent => :delete_all has_many :magazines, :through => :subscriptions validates_presence_of :name end class Magazine < ActiveRecord::Base has_many :subscriptions, :dependent =>
2006 Jul 27
0
Using CRUD + non-standard URLs
Hi, Please take a look at this code: map.with_options :controller => ''school'' do |m| m.school_show ''e/:id'', :action => ''show'' end map.resources :school map.connect '':controller/:action/:id'' And then I want a school to be shown on URLs like /e/123 and show a creation form on /school/new and have
2006 Jun 16
0
Where''s DHH''s slides on new CRUD presented at RubyKaigi2006?
Anxiously finding it... -- http://nohmad.sub-port.net
2006 Apr 05
0
Providing limited CRUD access to arbitrary tables through a web interface.
Hi There I''m starting Rails a project for the first time (used to work with PHP). I have to provide administrator ("super-user") access to a large number of tables. The access should be available through a web interface (the tables rendered as HTML forms on the browser, probably through HTML tables inside the form). From the CRUD set mostly R(etrieve) and U(pdate) are