similar to: collection_select: generated select tag not marked on error

Displaying 20 results from an estimated 2000 matches similar to: "collection_select: generated select tag not marked on error"

2005 Sep 06
4
url_for: :overwrite_params went missing
Somewhere between 0.13.1 and the current SVN version the :overwrite_params option to url_for (and related methods) went missing. I can''t tell whether this was deliberate or by mistake, and I have no idea how to get the same functionality in some other way either. Michael -- Michael Schuerig Life is what happens
2005 May 27
0
tag, content_tag: are nil-valued options ever useful?
In a number of places in my code I pass options whose value are '''' or nil to one of the tag-generation helper methods. In the HTML this shows up as, e.g. <span class=""> Now, this can be pretty wasteful, but I don''t want to change my evil ways. Thus I''d rather have the framework throw out these options than do it myself. AFAICT, all tag
2006 Aug 09
0
select-multiple for has_many association
I haven''t looked into this for several months, but there still doesn''t seem to be an obvious way to generate a HTML select element for choosing multiple items to be set for a has_many association. <select id="person_task_ids" multiple="multiple" name="person[tasks][]"> <option value="1">Do something</option>
2005 Oct 09
1
Setting the user for FastCGI processes?
I''d like to run the FastCGI as a different user than the Apache2 server (www-data on Debian). I take it this is possible in some way with suExec2, but so far I haven''t figured out how to do it. Michael -- Michael Schuerig Life is just as deadly mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org As it looks
2005 Aug 16
1
Defining model classes for enumerations
I have several tables for enumerations. They all have the same content: id, name, position. I''d like to avoid the tedious work of defining a class for each one explicitly. Not least, in order to avoid clutter in the model directory. Here''s what I''ve come up with: class EnumRecord < ActiveRecord::Base def self.define_enums(*enums) enums.each do |spec|
2005 Jun 13
3
validations not working with collection population droplists
I have an ADD form with foreign key field values selectable via select list ( collection_select (...)). When I add validates_presence_of :someotherfield to my model for error trapping, I get the following error for each droplist: NoMethodError in Reviews#create_curriculum Showing /reviews/_form.rhtml where line #16 raised: undefined method `inject'' for nil:NilClass Extracted source
2008 Apr 29
4
Default values for belongs_to and has_one
There really doesn''t seem to be a *declarative* way to define a default value for belongs_to and has_one associations class Person < ActiveRecord::Base belongs_to :address end p = Person.new p.address.city = ''Atlantis'' # Bummer! Of course, there''s an easy way to avoid this class Person < ActiveRecord::Base belongs_to :address
2007 Jan 03
3
Self-referential habtm with condition is broken
Here''s a simplistic model class. class Person < ActiveRecord::Base has_and_belongs_to_many :relatives, :class_name => ''Person'', :join_table => ''relatives'', :foreign_key => ''from_id'', :association_foreign_key => ''to_id'' has_and_belongs_to_many :brothers, :class_name =>
2009 May 12
4
has_many :through and scopes: how to mutate the set of associated objects?
I have a model layer containing Movie, Person, Role, and RoleType, making it possible to express facts such as "Clint Easterbunny is director of the movie Gran Milano". The relevant model and associations look like this class Movie < ActiveRecord::Base has_many :roles, :include => :role_type, :dependent => :destroy has_many :participants, :through => :roles, :source
2005 Aug 28
8
Save and delete buttons: POST vs. proximity dilemma
I''m in a dilemma: In order to keep GET requests from deleting objects, I''d like to use the button_to helper to get "something" that generates a POST request. Unfortunately, that something is a form and forms can''t be nested. I''d also like to place buttons related to the same form close to each other. At the top are some navigational buttons
2007 Jan 11
2
In-place editor for a whole form?
I want to implement in-place editing for a hierarchical structure where the nodes are not simple text fields, but need to be represented by at least two input elements. The Rails helpers only support in-place editing for a text field, scriptaculous''s controls.js beyond that implements support for an in-place editor containing a select element. I need an editor where I essentially
2005 Sep 13
12
PDF views?
I know there''s wiki page on generating PDF[*], but that''s not really what I want. I don''t need to create arbitrary PDF. What I''d like to do is create PDF templates and fill in the blanks. Roughly, I''m looking for functionality akin to the mail merge feature of word processors, including conditional and repeated elements, say, table rows. Michael
2005 Oct 18
0
Munging the class attribute: Benchmarks anyone?
In prototype/scriptaculous there are currently two different approaches to munging the class attribute of HTML elements. Scriptaculous has Element.Class which recently moved from util.js into effects.js. Prototype has Element.ClassNames and several convenience functions around it. In the past I''ve grown fond of Element.Class, but I''m perfectly willing to use
2010 Jun 20
0
ActiveRecord and ARel: correlated subqueries?
I''m trying to figure out how to use ActiveRecord in conjunction with ARel. In particular, I''d like to replace my residual literal SQL with ARel, if only I could see how. Let''s take Article with multiple Versions as an example. With ARel alone, I can find articles with their latest versions like this articles = Article.arel_table versions = Article.arel_table
2005 Aug 05
0
Finding by inclusion in nested set
Say I have tasks with a belongs_to association to categories where the later act as a nested set. Now I want to find all tasks belonging to a specific category (given as primary key) or any of its sub-categories. SELECT tasks.*, tasks_category.name FROM categories AS nested_set_categories, tasks LEFT OUTER JOIN categories AS tasks_category ON tasks_category.id = tasks.category_id WHERE
2005 Aug 23
0
Fixtures: pluraly bitten
With my functional tests (on PgSQL) I get strange errors like this 1) Error: test_create(AufgabeControllerTest): ActiveRecord::StatementInvalid: ERROR: duplicate key violates unique constraint "aufgaben_pkey" Tracking this down, I found that sequences are only reset for some of the tables I''m using. The reason? Inconsistent singularization. I won''t go so far as
2005 Oct 05
0
Database querying for synthetic attributes?
For some queries it is complicated to express them directly in SQL. Even more so when they are not hand-written, but generated from something the user entered. Say, the user wants to search for person records where the name contains some string. Now, while the Rails model may have a name attribute, the database table does not. There the name is decomposed into title, firstname, lastname and
2005 Sep 17
0
Reloading and redefining methods: infinite recursion
When I redefine a method like this class Klass alias_method :method_without_addition, :method def method_with_addition ... method_without_addition ... end alias_method :method, :method_with_addition end I get into trouble in the development environment. As these definitions are executed again for each request, the second time around method_without_addition is actually the
2008 Jan 21
1
JavaScript book recommendations
No, not a question, but a few suggestions. I take it that everyone serious about using Prototype & Co. already has Christophe''s (Porteneuve) Prototype and Script.aculo.us book. Apart from that, I''d like to point out two new, library-agnostic books: Cameron Adams and several others The Art & Science of JavaScript Sitepoint 2008 http://www.sitepoint.com/books/jsdesign1/
2005 Aug 19
13
Enumerations (again): Comments please
Some of my earlier questions may have hinted ever so slightly in the direction that I''m trying to implement "enumerations". By an enumeration here I mean a class that has a fixed number of immutable instances, which in turn have essentially only a name and a position. Requirements I''ve tried to meet are - Enumeration instances should only be loaded once from the