search for: bmathg

Displaying 7 results from an estimated 7 matches for "bmathg".

Did you mean: bcmath
2006 Aug 08
3
problem inserting parameters in link_to_remote
I want a page that lets users add members to a group from a longer list, or remove members from that group. I can use Ajax to transfer a name from the long list to the group, or drop an existing name from the group. But. If I add a person to the group, and try to remove without refresh, it doesn''t work. My link is formed by <%= link_to_remote ''add'', :url => {
2006 Aug 17
3
What''s the best way to stop repeating this line in my controller?
Hi, I am trying to follow the "DRY" principle and came across a problem. I am working on a small ajax task manager, and right now in the index page which renders the list, I have (for example, in the Lists controller): def index @lists = List.find(:all) end Now within the controller there''s also a list_add action which is called via ajax.. def list_add if
2006 Aug 16
0
Creating a comments system for multiple types of
It sounds like you want a polymorphic association - class Party < ActiveRecord::Base has_many :comments, :as => :commentable end class BlogEntry < ActiveRecord::Base has_many :comments, :as => :commentable end class Comment < ActiveRecord::Base belongs_to :commentable, :polymorphic => true end then include columns ''commentable_id'' and
2006 Aug 17
0
Re Automatically creating associated records with after_create
I don''t get what class Test is for, or where the registration model is, but remember that registrationS is the collection object. I think you want something like after_create { self.registrations << Registration.new } Cheers, B Gates I want to automatically create a registration entry when I add a new user to my application. This works fine, but it''s not
2006 Apr 12
0
Validating collections
I saw this issue addressed in mid-January under the heading ''TIP: Using field_error_proc to add style attributes to form elements'', but I didn''t quite get it. I have a collection of objects that I want to input in one form and validate (during update). The suggestion in the post I referred to above was to use something like [in form] > <% for @comment in
2006 Aug 04
2
problem eager loading with sti
Here''s the setup (working off Rails 1.1.4): Class Project belongs_to :employee Class Employee < Person has_many :projects When I try to paginate(:employees, :include => :projects) I get the error "Association named ''projects'' was not found; perhaps you misspelled it?" I can :include other models that the Person class has_many or habtm of, and if I
2006 Apr 14
2
spot the error (I can''t, I''m new)
I have a form that I want to use to update multiple objects. In the controller, @grades = Grade.find(params[:grade].keys) @grades.each_with_index do |grade, i| grade.update_attribute(params[:grade][i]) end all_valid = @grades.inject(true) {|memo, c| c.valid? && memo } this doesn''t update the attributes as I would expect. (I would just use