rails-models
query in rails3
In another question that i asked recently i got a really good answer and the code worked... But i do not know exactly why it works... Now i have a similar problem, but don\'t know how to solve it...?[详细]
2023-02-21 23:05 分类:问答rails3 model question
i moved from php to rails3, and i still think it was a good decision! Anyway I have some models: users[详细]
2023-02-21 07:00 分类:问答How do I prevent modifications to a Model?
In a current project, I have a model called Box that stores items from an online store. A box belongs to a Package (which defines price, payment conditions, etc) and has many Item and ExtraItem object[详细]
2023-02-19 19:42 分类:问答How do I edit one model from another's controller?
I have 2 models, user and group. user has_one group and group has_many users. I have a admin role, and a group admin role in my can can ability class that I want to be able to remove a user from the[详细]
2023-02-19 17:18 分类:问答Rails, string or integer values in status-column in db
I\'m having an event-model that has a status attribute, and wonder 开发者_Python百科if I should make it into a string or integer field.[详细]
2023-02-18 17:32 分类:问答Rails model references question
class CreateMatches < ActiveRecord::Migration def self.up create_table :matches do |t| t.integer :result_home[详细]
2023-02-13 19:24 分类:问答How do I model a table tennis match in rails
I am attempting to model a table tennis match in rails.Here is what I have: Game Model: team_1_score team_2_score[详细]
2023-01-18 14:22 分类:问答Belongs_to based on value of a field
I have a table with entries, and each entries can have different account-types. I\'m trying to define and return the account based on the value of cindof[详细]
2023-01-15 17:25 分类:问答In Ruby on Rails, if we generated a model "Animal", and now want to have "Dog", how should we do it?
say, if we generated a model rails generate model animal name:string birthday:date and now we want to create other model to inherit from it (such as Dog and Cat), should we use rails generate model[详细]
2023-01-14 20:46 分类:问答rails use counts in different views
Hello i guess this is going to be pretty noob question.. But.. I have an scaffold called list, which has_many :wishes. And with that information in my model, I can in my list view use this code[详细]
2022-12-31 02:55 分类:问答