virtual-attribute
STI and virtual attribute inheritance (Rails 2.3)
Say I have an STI relationship, where Commentable is the super class, and NewsComment is the subclass.In Commentable I have:[详细]
2023-04-10 17:59 分类:问答accepts_nested_attributes_for virtual attributes
I have 2 models: class Invoice < ActiveRecord::Base has_many :invoice_items accepts_nested_attributes_for :invoice_items, :allow_destroy => true[详细]
2023-03-26 21:48 分类:问答How Do I Parse a Text Field and then Write it to Multiple Models in Ruby on Rails?
I have simple project+task application I am creating in Rails 3.1.RC4. It will have project names, tasks and each task will be assigned to a person. The project form is simple with only two boxes (1)[详细]
2023-03-22 16:09 分类:问答Rails 3: Railscast #167 virtual attribute for creating tags - @user.tags
I would like to a tagging system where I can separate the tags by the user\'s who created them. I followed Railscast #167 about setting up tags using virtual attributes, but that way only lets me call[详细]
2023-03-15 06:19 分类:问答Rails 3: creating a validation with :if statement
Hi I\'m trying to setup a validation that is only called in a specific form view, to do this I\'m trying to create a hidden_fieldfor a virtual 开发者_如何学编程attribute on the form and set this to a[详细]
2023-03-13 23:53 分类:问答Rails 3 - Process text input to create multiple models
In the app I\'m working on, Courses have many Problems, which in turn have many Steps. Right now there is a form for adding Problems to Courses (and then Steps can be added to those problems). What we[详细]
2023-03-11 07:39 分类:问答Rails Validating on a virtual attribute, setting form error. Railscast #32
I\'m basically attempting to implement the solution from Railscast #32, modernized for Rails 3.0.7 http://railscasts.com/episodes/32-time-in-text-field[详细]
2023-03-08 16:13 分类:问答What's the best Rails convention for this?
Let\'s say that you have a resource that is created and displayed entirely within the view of开发者_Python百科 another resource (eg. comments or tags). Should you still make it it\'s own resource, or[详细]
2023-02-21 11:24 分类:问答rails 3 find or create based on multiple fields
I am trying to implement a simple tagging system using a tag virtual attribute on a notes object. a tag contains a label and a user_id. what I would like to do is update the HABTM to relationship to t[详细]
2023-02-05 09:23 分类:问答Using named scope with find_or_create_by
I spent some time figuring this out and haven\'t seen others post on it so maybe this will help someone. Also, I don\'t have much Rails experience so I\'d be grateful for any corrections or suggestion[详细]
2023-02-03 20:57 分类:问答