similar to: CRUD pattern for has_many relationships (forms containing collections)?

Displaying 20 results from an estimated 3000 matches similar to: "CRUD pattern for has_many relationships (forms containing collections)?"

2006 Apr 22
0
Re: CRUD pattern for has_many relationships (forms containin
Hi Christos, I''ve seen you message in the mailing list archive and I''m trying to achieve the same behaviour. Did you progress in your knowledge of the problem this you last posted? It seems the mailing list hasn''t been that helpful to you. Maybe we can work out a solution by us two. Cheers, gilles
2009 Jun 22
5
has_many through , or habtm , using form
i think there ara two ways of relate products and categories , basically i want to fix one product(e.g hp dv7....) to some categories (notebook,17"notebooks...) i made a table named categorization(incuding category_id,product_id fields) then in models i write these codes below class Product < ActiveRecord::Base has_many :categories, :through => :categorizations
2006 Jun 18
6
integer array columns
Postgres database. I have a categories table, with two columns id, and name. I have a recipes table, with a category_ids column. I want each recipe to belong to one or more category. in recipe_controller.rb I have this: def create @recipe = Recipe.new( @params[''recipe''] ) @recipe.category_ids = @params[''recipe''][''category_ids''].map{
2006 Jun 07
1
How do YOU read/update HABTM?
In my mind, it should work like this: <%= select ''item'', ''category_ids'', Category.find(:all).collect {|c| [c.name, c.id] }, {}, {:multiple=>true, :size=>20} %> Then Rails should automatically populate and update HABTM on that. As it is now, the above won''t work (I created a getter in item''s model that returns an array of
2006 May 31
3
instance variable problem
I''m having some trouble with an instance variable being read as nil in my app. I have an image uploading, that can be added to categories. The page loads up initially fine, and if I upload an image without errors everything works fine. I''m working on the validation, but with the code I have if their are validation errors it renders ''new'' again, but reads
2006 Apr 15
8
Inheritance in Rails - I need some help
I''ve got a model, "category" and another model "subcategory." Each subcategory belongs_to a category, and a category has_many subcategories. What I need to do is set it up so that I can search Category and Subcategory with one .find call. So: Category.find(:all, <etc) will find categories and subcategories. Now, I believe this can be done by making
2006 Nov 29
0
[761] trunk/wxruby2: Initial commit of HtmlHelpController & HelpController support + doc,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!-- #msg dl { border: 1px #006 solid; background: #369; padding:
2006 Jun 29
2
HABTM with multiple select list
Hello, I am very new to ruby and need to create my first HABTM with multiple select list.  I am having problems saving data in the middle(linking) table.  1. titles can have multiple categories  2. categories can have multiple titles Categories, titles and categories_titles tables are created.  ----- title_controller.rb--   def new     @title = Title.new     @categories =
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 Dec 25
6
undefined local variable or method?
I have: <%= form_for(@supplier) do |f| %> ....... ...... <%= render ''sector_categories'', :locals => {:f => f} %> in _sector_categories partial I have: <div class="field"> <div id="category_update"> <% for category in @categories %> <%= f.check_box :category_ids[], category.id,
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 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 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 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 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 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 Mar 02
2
custom sql queries beyond CRUD
Hi, I am just starting of in rails. I am trying to understand the features of rails and I have this burning question. (and search is not available now): Apart from relying on the automatic CRUD sql script produced, is there a way I can create my own sql script ex: with many joins between exixting tables (for reporting ). All I need is to declare the custom query and place the result in a
2006 Aug 05
0
Another generic CRUD controller
I''ve been using this template on most of my CRUD controllers. class CommentsController < ApplicationController meantime_filter :set_scope before_filter :find_comment, :only => %w(show edit update destroy) def index @comments = Comment.find(:all) end def new @Comment = Comment.new end def create @comment = Comment.create!(params[:comment])
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
2005 Dec 21
0
Category/subcategory CRUD
Hello there! This is my first post! ;) I''m starting on ruby on rails, so I have many doubts about it! I''m trying to create a system that uses categories/subcategories. I created a scaffold for a table that has the following fields: - id int(11) - name varchar(50) - keyname varchar(50) - visible enum(''0'',''1'') default ''0'' -