|
Sort of rails related, but yesterday Time Machine (OS X) completely saved my bacon. I had been working all day on a plugin for Mephisto and near the end I wanted to test out the install.rb functionality of the plugin. I had been working on the plugin in #{RAILS_ROOT}/vendor/plugins/mephisto_plugin. % script/plugin install vendor/plugins/mephisto_plugin rails: This directory already exists.. Use --force to override % script/plugin install vendor/plugins/mephisto_plugin --force Directory mephisto_plugin could not be found. (Yes I realize that this was a completely retarded way to go about testing it) To my horror I realized that the entire directory had been deleted. I grabbed the hourly backup from Time Machine all the while mumbling "please work please work please work". Hooray for hourly backups
|
# ? Mar 5, 2008 15:26 |
|
|
# ? May 15, 2024 23:15 |
|
Any of you looking for work? If you are already getting paid for RoR work, can I steal you away? Seriously, if you have actual working experience on Rails - I am drat near certain I can get you a pretty substantial pay increase by joining our shop.
|
# ? Mar 6, 2008 02:48 |
|
Hop Pocket posted:Hooray for hourly backups Are you not using source control?
|
# ? Mar 6, 2008 10:38 |
|
Pardot posted:Are you not using source control? I am, but I don't commit every hour. Usually at the end of the day or work period.
|
# ? Mar 6, 2008 13:39 |
|
Hop Pocket posted:I am, but I don't commit every hour. Usually at the end of the day or work period. I tend to check in every feature or bug fix, which normally corresponds to items in jira. It makes it easier to do release notes, and link your scm to your issue tracker. Doing a check in at the end of every day tends to lead to every dev doing that and build breakage.
|
# ? Mar 6, 2008 15:37 |
|
jonnii posted:I tend to check in every feature or bug fix, which normally corresponds to items in jira. It makes it easier to do release notes, and link your scm to your issue tracker. I agree, but sometimes a particular task will take you the better part of a day, as was the case here. In other words, there was no point in checking it in until the issue I was working on was resolved. Anyways, sorry for the derail, back to rails related things
|
# ? Mar 6, 2008 20:14 |
|
Is anyone an expert with Ferret/acts_as_ferret? I'm confused why code:
However, code:
I've gone through the source and Ferret's query parser builds, as far as I can tell, the exact same PhraseQuery object before it goes searching so I'm not seeing why there is a discrepancy. Edit: Found it. The query parser builds the phrase query like this: code:
skidooer fucked around with this message at 05:50 on Mar 7, 2008 |
# ? Mar 7, 2008 04:56 |
|
In case some of you missed this, there's a new version of rubygems, 1.1.0, out. It's supposed to be much faster at indexing, but I haven't had a chance to test it out yet. Just run sudo gem update --system to get it. http://blog.segment7.net/articles/2008/03/29/rubygems-1-1-0
|
# ? Mar 29, 2008 19:33 |
|
Pardot posted:In case some of you missed this, there's a new version of rubygems, 1.1.0, out. It's supposed to be much faster at indexing, but I haven't had a chance to test it out yet. Just run sudo gem update --system to get it. I'm on leopard, and I had to run code:
|
# ? Mar 29, 2008 20:53 |
|
Hop Pocket posted:I'm on leopard, and I had to run You know, I read some blog comment that someone else had to do this too, but I just did clean install of leopard on my macbook and the regular gem update --system worked fine. That was using the ruby that came with it, not macports or anything. I wonder what causes the difference.
|
# ? Mar 30, 2008 09:10 |
|
Pardot posted:You know, I read some blog comment that someone else had to do this too, but I just did clean install of leopard on my macbook and the regular gem update --system worked fine. That was using the ruby that came with it, not macports or anything. I wonder what causes the difference. I was also able to upgrade cleanly that way on my 2ish month old install of Leopard. I'm running ruby 1.8.6 from macports.
|
# ? Mar 31, 2008 00:06 |
|
The new timestamp migrations in edge rails is cool and solves the problem of two people checking migrations with the same number (though you should update your copy before checking in and notice this anyway ). It might solve my biggest issue with migrations, too but I'm not sure -- I'd have to try it out. It's when you branch for a release and continue working on trunk, and then have to fix something on your branch right away that involves a migration. What I've done before with that is to flatten the migrations down to a single migration before the branch, then skip several numbers for the next trunk migration. Ugly. The other awesome edge rails thing is the gem dependancies. You specify what gems you need in environment.rb rake gems:install - installs all the gems your app needs rake gems:unpack - vendors all the gems
|
# ? Apr 3, 2008 20:35 |
|
Pretty interesting stuff here: http://www.modrails.com/ http://izumi.plan99.net/blog/
|
# ? Apr 9, 2008 16:57 |
|
bmoyles posted:Pretty interesting stuff here: Just what we need: another apache module for connecting to external code that is not only language specific, but framework specific. I'm sure it will be as good as mod_python, mod_perl, mod_mono, and countless others. I don't understand why people can't just come up with decent FastCGI bridges. Also, what is wrong with a mongrel cluster and mod_proxy?
|
# ? Apr 10, 2008 23:51 |
|
brae posted:Also, what is wrong with a mongrel cluster and mod_proxy?
|
# ? Apr 11, 2008 00:59 |
|
And they've said that it won't be rails specific in the long run, but will work with all rack compatible frameworks.
|
# ? Apr 11, 2008 01:13 |
|
A few basic ruby questions for you guys. I'm writing a script that takes a list of names, puts them into an array, and then generates a .csv file for use with windows server 2003 to add users in. This is what I have so far: code:
Obviously the last part was just to test that it worked. I'm sure there's a better way to go about what I've done so far, but that's what I came up with. The next part of the coding I have to do is to generate the csv file, it looks like this: code:
Full name - done OU, DC, and DC remain static First Initial + Last Name Previous + test.com The rest remain static. The full name is stored in an array (a), the first and last name are separated by a space. I know how to make a string from these things, but I don't know how to generate the rest, and how to have it loop for however many entries in the array there are. I also am somewhat confused about writing to a file. ---Huge Edit--- I got off work and was bored, so I tore into this with some help from #ruby on freenode, and the full solution/input file so you can see it work can be found here: http://pastie.org/185259 Popcorn Sutton fucked around with this message at 04:46 on Apr 23, 2008 |
# ? Apr 22, 2008 20:59 |
|
You don't need to use counter variables anymore, or define arrays, or use while loops or for loops anymore now that you've entered the magical world of ruby! Here's a quick refactoring of your code. I don't really like how you were using regexes to generate the account name, but I didn't want to figure out a different way to do it. http://pastie.org/185316 I put it in as a picture for the syntax highlighting, to see how I'd like it. I think it works well for short-to-medium length stuff like this.
|
# ? Apr 23, 2008 07:04 |
|
Another take:code:
|
# ? Apr 23, 2008 16:01 |
|
Is session data stored in the cookie by default? Is that why there is a 4kb limit?
|
# ? Apr 24, 2008 08:40 |
|
Sewer Adventure posted:Is session data stored in the cookie by default? Is that why there is a 4kb limit? Yes and yes. Cookie based sessions were made the default in revision 6184 back in February 2007. r6184 posted:Introduce a cookie-based session store as the Rails default. Sessions typically contain at most a user_id and flash message; both fit within the 4K cookie size limit. A secure hash is included with the cookie to ensure data integrity (a user cannot alter his user_id without knowing the secret key included in the hash). If you have more than 4K of session data or don't want your data to be visible to the user, pick another session store. Cookie-based sessions are dramatically faster than the alternatives. What are you doing that needs more that 4k for the session? Typically you shouldn't store entire objects in the session. Rather, store the id, and then do Model.find session[:whatever].
|
# ? Apr 24, 2008 09:15 |
|
Pardot posted:Yes and yes. Cookie based sessions were made the default in revision 6184 back in February 2007. Thanks and yeah I was storing whole objects for a shopping cart and it was giving cookie overflows when people tried to buy lots of stuff, but storing the ids is definitely a better idea
|
# ? Apr 24, 2008 11:08 |
|
I got bit by the 4k limit just a couple of days ago. We were using the cacheable flash strategy to store flash in the cookies (for an instance where we had to have page level caching) and we ended up putting form error validations, and then form values into the cookie was well. BOOM!
|
# ? Apr 24, 2008 14:39 |
|
Hey guys, doing another ruby script, this time for the adding of an exchange server mailboxes using the same namelist as before. Here's the code: (I'm using my code for this still as I didn't really understand the awesome fast code enough to modify it to my own needs) code:
code:
Thanks again for the help guys, no idea what i'd do without you. (Probably sit in #ruby on freenode and beg for help. Also, for those of you who might play poxnora I'm coding a really awesome ruby app for our upcoming project GOONMALL.
|
# ? Apr 25, 2008 16:51 |
|
Popcorn Sutton posted:Why is it breaking tables? You don't have a 'do' to go along with your 'while'. Also, while loops aren't very ruby idiomatic. You could try something like this instead: code:
|
# ? Apr 26, 2008 16:43 |
|
I hope this thread hasn't slumped off since I found it on the second page. I'm trying to get into Rails now, but I keep getting spanked. My big problem is integrating with and IDE. I've found the Ruby Eclipse plugins just don't function. I'm lucky to get a source file up in there, and then luckier still to run something, but never enough to debug. NetBeans had promise, but it seems out of sync with the newer rails stuff I have on my box. Now mongrel shits itself with this when I hit the top page in a new, default project in NetBeans:code:
Ruby as a language has been interesting, but I keep getting burnt with gems and gluing together the complex stuff I need.
|
# ? Apr 30, 2008 18:58 |
|
Rocko Bonaparte posted:IDE Stuff Most of the coders I know who do Rails don't use an IDE. Rails has some decent error messages, and with unit testing (if you are so inclined) that should provide strong tools to debug. I know I've never really looked at using an IDE because it never seemed necessary for a scripting language like ruby.
|
# ? Apr 30, 2008 19:37 |
|
I have to give up thrashing on this as much as I do in a day since it's not moving anywhere. I got off NetBeans and managed to get the Hello World tutorial working off of https://www.rubyonrails.org. But as soon as I try to do something with the database, I get an error from rake db:create "uninitialized constant ActiveRecord." I have no idea what to do to fix it for my system. The gem is installed--that's about all I know. Nobody on IRC could help. I'm new enough that I don't know where to look to start figuring this stuff out. If nobody can help I have to give up on it for now. It's just amazing to me to think that other people could have the tutorials kick off fine and dandy when they poo poo on me almost immediately. Do most people develop on Windows or something? I wonder if it's the fact that I'm on Ubuntu that makes everything unstable.
|
# ? May 1, 2008 04:23 |
|
What's the migration that you're using?
dustgun fucked around with this message at 05:07 on May 1, 2008 |
# ? May 1, 2008 05:03 |
|
I am unsure. I reference ActiveRecord in the tutorial's first migrate script:code:
code:
|
# ? May 1, 2008 06:30 |
|
Rocko Bonaparte posted:I am unsure. I reference ActiveRecord in the tutorial's first migrate script: You're using Rails 2.0 but using the old migration style. I'm not 100% sure if that still works, but check out 'sexy migrations' which is now in use. There's a good Railscasts episode on it: Migrations in Rails 2.0 EDIT: It can sometimes be a struggle to keep up with the constant changes in Rails. It's useful to keep an eye on the main Rails page and other Rails related blogs, its usually enough for me.
|
# ? May 1, 2008 14:56 |
|
B1axident posted:EDIT: It can sometimes be a struggle to keep up with the constant changes in Rails. It's useful to keep an eye on the main Rails page and other Rails related blogs, its usually enough for me. The tutorial I was using was even off the rubyonrails.org site.
|
# ? May 1, 2008 15:40 |
|
in rails 2.0 it creates the migrations for you when you use script/generate model, maybe re-try that step?
|
# ? May 1, 2008 18:57 |
|
Rocko Bonaparte posted:I'm certain it is especially when I'm trying to learn off tutorials and don't know anything about these concepts yet. Should I be looking for rails 2.0 tutorials or something? All of their screencasts are from old versions and haven't been updated. Yeah, have a google for some Rails 2.0 tutorials, to get yourself upto date, there's quite a few around. Also if you're thinking of buying a textbook, wait until the new version of 'Agile Web Development with Rails' comes out, as that's all updated for Rails 2.0. Think you can buy a beta pdf already!
|
# ? May 1, 2008 19:34 |
|
Ok I'm writing a database app with a database of Quotes. Each quote can be on multiple People. So i have two tables, Quotes, and People. Quotes has_many People and People Belongs to Quotes etc. I've gotten that far and no problem manually adding in quotes and people associated with said quotes. I also have coded a successful viewer app that correctly associates quotes with people. My database looks like this code:
Anyway I can't quite figure out how to submit a new quote using this scheme setup. The form builder seems to only like dealing with a single object (just quotes, or just people, but not both). Can anyone point me in the right direction? I'm still pretty new to rails. Thanks for any help Edit: just to be clear I'll make a blog system analogy: I'm basically trying to make a Submit New Blog Post form that would let you submit a new blog post ALONG with a few user discussion comments for the blog post in the same form/action. So after all the standard blog fields (title, body, etc) you would have a couple rows of these fields: User - Comment, User - Comment, etc. bag of a bee fucked around with this message at 05:39 on May 2, 2008 |
# ? May 2, 2008 05:06 |
|
bag of a bee posted:The form builder seems to only like dealing with a single object (just quotes, or just people, but not both). code:
code:
code:
|
# ? May 2, 2008 05:50 |
|
You may also want to take a look at the Complex Rails Forms series at railscasts. http://railscasts.com/episodes/73 http://railscasts.com/episodes/74 http://railscasts.com/episodes/75
|
# ? May 2, 2008 06:46 |
|
Pardot posted:You may also want to take a look at the Complex Rails Forms series at railscasts. This helped me immensely when I was trying to do the same thing a few weeks ago. You may have a little trouble getting it to work if you're only creating one additional child object however.
|
# ? May 2, 2008 10:26 |
|
I finally found a rails 2.0 tutorial that seemed to work. I've concluded that I will ultimately need to get a book in order to explain how everything fits together. I don't think I can get enough from the tutorials to figure out how it all goes. It also looks like the kind of thing you can't figure out entirely from looking at other people's sources; a big part of the process is generating everything as you plod along. I'll see if I can scoop up a rails 2.0 book at the library here, but it sounds like I might have to wait.
|
# ? May 2, 2008 23:05 |
|
|
# ? May 15, 2024 23:15 |
|
Rocko Bonaparte posted:I finally found a rails 2.0 tutorial that seemed to work. I've concluded that I will ultimately need to get a book in order to explain how everything fits together. I don't think I can get enough from the tutorials to figure out how it all goes. It also looks like the kind of thing you can't figure out entirely from looking at other people's sources; a big part of the process is generating everything as you plod along. I'll see if I can scoop up a rails 2.0 book at the library here, but it sounds like I might have to wait. I'm personally the type of guy that needs the book, so always gets one! There aren't many Rails 2.0 books out yet I can only think of the The Rails Way and the updated Agile Web Development With Rails. Keep in mind that the Rails Way is for more experienced users. Here's some info on recommended Ruby books: http://antoniocangiano.com/rails-books/
|
# ? May 4, 2008 00:37 |