|
Operation Atlas posted:With couchdb you don't really need migrations- if you do it right you can keep older objects in the older schema and only update the database record when necessary, and when they get saved they get saved in the new schema. When you do a query (i.e. make a view), don't you have to take both 'schemas' into account? Won't that get unwieldily after a while?
|
# ? Nov 25, 2009 00:03 |
|
|
# ? May 15, 2024 15:39 |
|
Mr. Wynand posted:When you do a query (i.e. make a view), don't you have to take both 'schemas' into account? Won't that get unwieldily after a while? Queries are done by class attribute, so no. Full-text search is handled by Lucene, which doesn't care either. The only exception are reports, of which I've had to do one on the couchdb side (the rest I've been able to fetch a bunch of data and process it in ruby), and are pretty easy to update and add an "if" statement, or to go ahead and run a "migration" which just goes through all the records and saves them, therefore updating them to the new schema.
|
# ? Nov 25, 2009 16:23 |
|
I've been hard at work developing a plugin for Rails that generates a uniform, standards-compliant and easy to navigate administration interface for all models in a given app. It will feature its own single-user authentication system bundled (probably SuperSimpleAuthentication), but will also feature hooks to other popular multiuser solutions like restful_authentication and Authlogic (requires an extra flag upon generation and a migration run). The plugin is called rootkit and it's meant to make developing a backend, an area of the site where a limited amount of people will be viewing, easier so more care can be taken for the high-traffic frontend. All too often I find myself tediously coding an admin interface for a site because inline administration would just make things incredibly confusing. The only real difference is modifying how it authenticates users for entry into the admin section. This idea was borrowed from Django, which includes a built-in secure authorization system as well as live administration control panel which automatically adds new models you've created. I've created the bare bones of what I want it to do. There are a couple meta-programming things that I honestly don't know how to do (like finding all Model classes for the given application), but I'm going to be delving deeper into Ruby to figure poo poo out. If anyone out there would like to contribute to this project, the repo is located at http://github.com/tubbo/rootkit. If you would like to contribute, message me through github or email tubbo (at) psychedeli (dot) ca
|
# ? Nov 27, 2009 19:30 |
|
Quick Question. I went to install InstantRails for Windows development. The only legit once I've been able to find is here at RubyForge: http://rubyforge.org/projects/instantrails/ But it says it was last updated in Dec 2007. That doesn't seem right to me. Is there another place I can get it, or is this actually the latest version? Or should I go through the process in this guide instead? http://blog.mmediasys.com/2009/07/06/getting-started-with-rails-and-mysql/ And before anyone mentions it, I wont be using another OS so please don't bring that up. Thanks
|
# ? Nov 27, 2009 20:44 |
|
Yeah Instant Rails has been stagnant for years and is probably dead. That link looks pretty comprehensive, try to follow it exactly and you should be okay. If you get stuck feel free to ask, we'll try and help.
|
# ? Nov 27, 2009 22:08 |
|
NotShadowStar posted:Yeah Instant Rails has been stagnant for years and is probably dead. That link looks pretty comprehensive, try to follow it exactly and you should be okay. If you get stuck feel free to ask, we'll try and help. Thanks, I'll do that.
|
# ? Nov 27, 2009 22:47 |
|
CHRISTS FOR SALE posted:I'm developing a similar kind of thing for CouchDB. I'll let you know when it is ready to be released.
|
# ? Nov 28, 2009 00:04 |
|
CHRISTS FOR SALE posted:It's a great idea, especially in early stages of dev / beta releases you can live with a really basic admin views. It really doesn't take very long to implement, but if there was an option to skip it... Few things though: 1. Why not use it as an Engine? I don't see why you need to generate craploads of views and controllers in the app itself. Let user override defaults if he wishes though. 2. @models = Model.all(:table => RAILS_APP) How does that even work? I checked documentation just to be sure, but there's nothing like this there. Plus, wouldn't you just want AR models? 3. Tests. If there are no tests - it doesn't work.
|
# ? Nov 29, 2009 18:16 |
|
BUGS OF SPRING posted:I went to install InstantRails for Windows development. If you don't have any luck with that guide, perhaps give JRuby a whirl. Rails' script/server works for development, or there's the the glassfish gem. I've got it running with minimal fuss on OSX and I've heard positive things about its use on Windows.
|
# ? Nov 30, 2009 11:50 |
|
Can someone please help me understand why my code is so unwieldy? I've been teaching myself, but it looks like I'm missing some remedial Ruby concepts. I'm writing a browser based game/following a tutorial as another learning exercise and have a simple combat system set up. My fight(monster) method returns an Array called @combat. I'm trying to customize my model so the browser receives different messages depending on some of the equations inside the fight(monster) method. It works, but what I've done can't possibly be the best way to go about spitting out messages from a method that returns an array that 'should' be able to store a bunch of additional strings for me. Here's some of the code in my Player model along with questions (as comments): code:
plasticbugs fucked around with this message at 11:03 on Dec 2, 2009 |
# ? Dec 2, 2009 10:45 |
|
plasticbugs posted:Can someone please help me understand why my code is so unwieldy? I've been teaching myself, but it looks like I'm missing some remedial Ruby concepts. I think you need classes for the entire Fight and the Turns. They don't need to be ActiveRecord classes, just stuff the vanilla classes in lib. Then what you'd do is create a new Fight object, assign the attacker and defender, and then do @fight.commence (or whatever), and that method would handle the creation of turns and the storing of results in an instance variable in the @fight object (you don't have to return anything).
|
# ? Dec 2, 2009 16:22 |
|
plasticbugs posted:code I'm not happy with the perform_turn, but here's a shot. code:
Pardot fucked around with this message at 01:11 on Dec 3, 2009 |
# ? Dec 2, 2009 19:20 |
|
Pardot posted:I'm not happy with the perform_turn, but here's a shot. This is an enormous help. Thank you for your time. I'm taking your advice and will be looking into Rspec and Cucumber this weekend. Is Cucumber the best way to go about BDD? I know enough Ruby/Rails to be exceedingly dangerous, so is it too early for me to start learning how to write tests? Or is writing tests an integral part of learning (not just Rails but intelligent programming)? EDIT: typo plasticbugs fucked around with this message at 21:39 on Dec 2, 2009 |
# ? Dec 2, 2009 20:35 |
|
plasticbugs posted:is it too early for me to start learning how to write tests? Or is writing tests an integral part of learning (not just Rails but intelligent programming)? It is never too early to start writing tests. Learning rails without testing is kind of a guessing game and what works seems to be magic or an incomprehensible collection of mystery settings. Using rspec (or another testing framework) will take the guesswork out and will let you know exactly what broke when so that you can fix things more quickly, more easily, and with less magic.
|
# ? Dec 2, 2009 21:02 |
|
Operation Atlas posted:It is never too early to start writing tests. Learning rails without testing is kind of a guessing game and what works seems to be magic or an incomprehensible collection of mystery settings. Using rspec (or another testing framework) will take the guesswork out and will let you know exactly what broke when so that you can fix things more quickly, more easily, and with less magic. Thanks. One more question. Any advice on first steps? I see that Pragprog has an upcoming book on the subject. Until it comes out, is there another book you recommend?
|
# ? Dec 2, 2009 21:43 |
|
Operation Atlas posted:It is never too early to start writing tests. Learning rails without testing is kind of a guessing game and what works seems to be magic or an incomprehensible collection of mystery settings. Using rspec (or another testing framework) will take the guesswork out and will let you know exactly what broke when so that you can fix things more quickly, more easily, and with less magic. Just saying, although I agree testing is awesome, debugging rails isn't magical at all without it.
|
# ? Dec 3, 2009 00:33 |
|
plasticbugs posted:Thanks. One more question. Any advice on first steps? I see that Pragprog has an upcoming book on the subject. Until it comes out, is there another book you recommend? The book is basically finished. Just buy the beta version. I found it quite good.
|
# ? Dec 3, 2009 00:50 |
|
Trabisnikof posted:Just saying, although I agree testing is awesome, debugging rails isn't magical at all without it. When you're first starting it sure can seem like it.
|
# ? Dec 3, 2009 02:48 |
|
GroceryBagHead posted:1. Why not use it as an Engine? I don't see why you need to generate craploads of views and controllers in the app itself. Let user override defaults if he wishes though. GroceryBagHead posted:2. @models = Model.all(:table => RAILS_APP) How does that even work? I checked documentation just to be sure, but there's nothing like this there. Plus, wouldn't you just want AR models? GroceryBagHead posted:3. Tests. If there are no tests - it doesn't work.
|
# ? Dec 5, 2009 07:20 |
|
CHRISTS FOR SALE posted:I'll look into it. What I was trying to accomplish was something that would be easy to implement, a 3-step process that doesn't REQUIRE any dependent plugins. Maybe you're thinking about old 3rd party Engines. Rails 2.3 has that functionality built in: http://railscasts.com/episodes/149-rails-engines So instead of your 3-step process there's only one step: install gem.
|
# ? Dec 5, 2009 16:18 |
|
plasticbugs posted:Thanks. One more question. Any advice on first steps? I see that Pragprog has an upcoming book on the subject. Until it comes out, is there another book you recommend? Assuming you mean The rSpec Book the beta PDF is a prefectly fine start. I went from 0 knowledge of cucumber/rspec to regularly doing BDD & testing in every project.
|
# ? Dec 8, 2009 00:36 |
|
Does Rails not offer any core option for time_select to display hours in a 12 hour format. I googled and this was about the only old good option http://code.google.com/p/rails-twelve-hour-time-plugin/ Is that what everyone uses?
|
# ? Dec 8, 2009 04:06 |
|
stack posted:Does Rails not offer any core option for time_select to display hours in a 12 hour format. I googled and this was about the only old good option code:
|
# ? Dec 8, 2009 09:12 |
|
Sewer Adventure posted:
Thanks but I was asking about form inputs. Specifically time_select and any option or preferred plugin to provide a different set of inputs for time entry than the 24 hour default.
|
# ? Dec 8, 2009 15:50 |
|
stack posted:Does Rails not offer any core option for time_select to display hours in a 12 hour format. I googled and this was about the only old good option That's the only thing I've found.
|
# ? Dec 8, 2009 20:12 |
|
phazer posted:Assuming you mean The rSpec Book the beta PDF is a prefectly fine start. I went from 0 knowledge of cucumber/rspec to regularly doing BDD & testing in every project. Yep, I bought it last week and I'm amazed at how much I've been able to grasp so far. The PDF will live on my Sony Reader until the paper version comes out. I have a question about IDEs and design. Is there a way I can set-up Textmate to show a live preview of my edits in a browser window - like if I'm tweaking CSS? If not, is this something that Coda does with a Rails project?
|
# ? Dec 9, 2009 00:45 |
|
plasticbugs posted:I have a question about IDEs and design. Is there a way I can set-up Textmate to show a live preview of my edits in a browser window - like if I'm tweaking CSS? If not, is this something that Coda does with a Rails project? I don't know about IDE support, but some guys I met at Windy City Rails this september wrote this which seems cool: http://github.com/tilleryj/CSS-Push I haven't used it myself yet though.
|
# ? Dec 9, 2009 00:50 |
|
Has anyone else experienced this problem with Restful Authentication & Webrat? http://rails_security.lighthouseapp.com/projects/15332/tickets/46-cucumber-features-not-passing-on-rails-232-with-webrat-043 (the forums aren't parsing this URL properly, sorry, can't link) I have Rails 2.3.5, latest Restful Authentication and WebRat 0.5.3 When I run the features, most of them fail due to ra_response_spec.rb not finding "div.notice", but if I use the application manually in the browser, it's all working as expected, with "div.notice" in the source. I have one feature I wrote so far using webrat to find the text in a flash message, and it fails, too. Even though the text is there when tested in the browser.
|
# ? Dec 10, 2009 14:58 |
|
Are you logging in and/or setting the appropriate session data before each of these actions?
|
# ? Dec 10, 2009 15:56 |
|
Operation Atlas posted:Are you logging in and/or setting the appropriate session data before each of these actions? Admittedly, I assume the features that come with Restful Authentication are written correctly and should pass out of the box. Googling my problem, I've found other people who have issues with webrat, but have yet to find a solution. I'm also open to any advice on how to figure out a solution. The features fail in the same way with webrat commented out :/
|
# ? Dec 10, 2009 16:19 |
|
phazer posted:Admittedly, I assume the features that come with Restful Authentication are written correctly and should pass out of the box. Googling my problem, I've found other people who have issues with webrat, but have yet to find a solution. I'm also open to any advice on how to figure out a solution. Admittedly I haven't done any work with webrat, but I'm assuming it isn't any different than selenium etc. Things should and will fail with Restful Authentication unless you actually log in first. How else is it going to know what user you're supposed to be logged in as? How else are you going to test that authentication is working properly?
|
# ? Dec 10, 2009 17:19 |
|
Operation Atlas posted:Admittedly I haven't done any work with webrat, but I'm assuming it isn't any different than selenium etc. I guess what I meant is I assume the features that come with Restful Auth are written to do what you describe. Isn't it bad practice to release/commit code with failing tests? Shouldn't I be able to assume RA comes with passing tests? Here's an example of a failing scenario from RA default installation: code:
code:
code:
|
# ? Dec 10, 2009 17:35 |
|
Follow up Webrat 0.6.0 removed "css_search" from Webrat::XML Freezing webrat-0.5.3 solved my "Then I should see regexp" problem.
|
# ? Dec 13, 2009 18:58 |
|
Might want to check out Capybara which is intended to be a drop-in replacement for Webrat in Cucumber and tests at the Rack level, with fallback to Selenium if you need to.
|
# ? Dec 15, 2009 23:37 |
|
Hey, CHRISTS FOR SALE in some other thread you mentioned you were using macruby? How is it? Also anyone who as built more than the hello world I did, what do you think of macruby?
|
# ? Dec 18, 2009 18:52 |
|
I designed a small website for my dad using Rails last year. A few pages, some nifty admin stuff for him to log in and upload images to his gallery, edit his links, that kind of thing. The only third-party gem I'm using is RMagick to create image thumbnails, IIRC. It's being hosted on a shared hosting package (one of the hosting threads in SA Mart) and occasionally the Mongrel just dies unexpectedly. There's nothing useful at all in the logs except for the message that SIGTERM was sent to the process: code:
Does anybody have any suggestions for obvious things that I can keep an eye out for? Is there any way to get better diagnostics when this happens, or at the very least, force Mongrel to restart automatically? I don't have SSH access to the host (yeah, I know, but the draw was that it was cheap for my dad), so my options may be a little limited.
|
# ? Dec 28, 2009 22:44 |
|
I have a few webservices that publish rss information to myself for this or that. One is a small rails app and the others are small rack apps. If you're not expecting a ton of traffic or you don't require much database space then heroku is the right option. Their lowest tier service is free and works just fine for personal websites/apps. http://heroku.com/pricing#blossom-1
|
# ? Dec 28, 2009 22:53 |
|
Flobbster posted:Does anybody have any suggestions for obvious things that I can keep an eye out for? Is there any way to get better diagnostics when this happens, or at the very least, force Mongrel to restart automatically? I don't have SSH access to the host (yeah, I know, but the draw was that it was cheap for my dad), so my options may be a little limited. If you're using an old version of RMagick, there's a memory leak in it. Once the mongrel process gets too big the OS will kill it. That's my #1 guess as to what's going on. First, upgrade to the latest RMagick/ImageMagick combo. Second (if possible) upgrade to Nginx/Passenger. Way better than mongrel.
|
# ? Dec 29, 2009 04:59 |
|
I just have a question since the new thing seems to be running passenger/nginx. Is there any reason to use that combo during development at all?
|
# ? Dec 29, 2009 05:40 |
|
|
# ? May 15, 2024 15:39 |
|
Randuin posted:I just have a question since the new thing seems to be running passenger/nginx. Is there any reason to use that combo during development at all? Some people really like it, using some preference pane thing. However everyone who's told me that they like it are contractors who are switching between apps often. I'm just building a single app, so I stick with script/server, and that's been fine.
|
# ? Dec 29, 2009 05:42 |