|
ANAmal.net posted:I'm really not a fan of Rails for the most part, but sticking to the thread topic, I will say that the logging (especially in development mode) is the most thorough I've ever seen. It's wordy as hell, but pretty much anything you would ever need is in there, provided you can grep your way to it. Agreed, I usually tail the development log all the time and it's incredibly useful. It really does show you everything.
|
# ¿ Aug 8, 2007 21:10 |
|
|
# ¿ Apr 29, 2024 08:10 |
|
MrSaturn posted:Hey, a rails question! Why are you prefixing script\generate by rails? It should be ruby if anything.
|
# ¿ Aug 10, 2007 17:07 |
|
Here's a question because I've never messed with this before. I have a method_missing method in my ActiveRecord Model that intercepts two kinds of dynamic method calls. It does this well and everything is fine and dandy, however, all the other dynamic methods that ActiveRecord uses are not recognized now. If I get no result how do I call ActiveRecords base method_missing to do whatever it has to do or raise exceptions?
|
# ¿ Aug 10, 2007 18:46 |
|
skidooer posted:Call super to pass it up to the superclass. For example: Strange, I tried just that and I don't think it worked. I'll try again, maybe I hosed something up. This is what I get for implementing permissions as an quasi bitfield in the database.
|
# ¿ Aug 10, 2007 19:14 |
|
You guys know you're supposed to consolidate your migrations every once in a while, right? You're probably not going to go back to that migration you were using 200 version ago or whatever.
|
# ¿ Aug 10, 2007 21:53 |
|
Before haml existed I tried making a page with Builder because I was sick of the terrible indentation and it was a nightmare. haml looks perfect and sass looks fantastic too, I think I'm going to start using them from now on.
|
# ¿ Aug 11, 2007 09:37 |
|
MrSaturn posted:Let's say I've got an item called a house in my database. I want a house to be able to create a room. What syntax do I have to use to get the user that created the house, given only the house object? I thought it'd be like If the foreign key to the user is called "user_id" then that should work. Is House the house object or the model name? User.find(house[:user_id]) should work If you have a belongs_to :user in your House model, then when you first find the house you can add :include => :user (I think that's the syntax) which will give you house[:user][:username], etc... capabilities.
|
# ¿ Aug 15, 2007 19:01 |
|
MrSaturn posted:where would I put :include=>user ? Here's an example: @houses = House.find(:all, :include => :user) and your new favorite page: http://api.rubyonrails.com/classes/ActiveRecord/Base.html#M000992
|
# ¿ Aug 15, 2007 19:27 |
|
Al Azif posted:I've been using Ruby for a while now, but this is my first foray into Rails (I'm a big fan of Camping, but past a certain size Camping apps get difficult to handle). before_filter :get_session_user Then in application.rb make a private method that does @user = find_user.
|
# ¿ Aug 30, 2007 18:33 |
|
|
# ¿ Apr 29, 2024 08:10 |
|
atastypie posted:I find my helpers are generally empty, with things like this going in my model: That's definitely content for the model, your helpers should be used moreso for html junk that you repeat over and over again that doesn't really fit into partials.
|
# ¿ Oct 10, 2007 21:04 |