|
The Journey Fraternity posted:why the lucky stiff, maybe? YESSSSS!!!! Thank you.
|
# ? Aug 9, 2007 12:01 |
|
|
# ? May 15, 2024 04:52 |
|
shopvac4christ posted:You mean code coverage? Like rcov? I saw that you CAN use HTML elements, but the style seems to encourage making everything divs (as does the giant example on the homepage).
|
# ? Aug 9, 2007 12:44 |
|
Whats everyone using as a Rails IDE? I just installed Apanta/RadRails for Eclipse and its looking very convenient, if a little shallow. Still more then SciTE/Notepad++, but still, a nice IDE goes a long ways.
|
# ? Aug 9, 2007 12:48 |
|
Walrus791 posted:Whats everyone using as a Rails IDE? I just installed Apanta/RadRails for Eclipse and its looking very convenient, if a little shallow. Still more then SciTE/Notepad++, but still, a nice IDE goes a long ways. RadRails is pretty cool, but it's crashed on me five or six times in a week before, and I can't say I've ever had that problem with a regular text editor. Considering RadRails adds little value besides loving up my indentation when I'm trying to code, and sticking in end tags where I don't want them, I decided to pass. I should also note that the multi-monitor support in Eclipse is absolutely awful. Vulture Culture fucked around with this message at 14:07 on Aug 9, 2007 |
# ? Aug 9, 2007 14:03 |
|
Walrus791 posted:Whats everyone using as a Rails IDE? I just installed Apanta/RadRails for Eclipse and its looking very convenient, if a little shallow. Still more then SciTE/Notepad++, but still, a nice IDE goes a long ways. I just use Textmate and have autotest, mongrel, and script/console open in different terminals as I develop. More window clutter but I never got into Eclipse/Radrails.
|
# ? Aug 9, 2007 14:08 |
|
RonaldMcDonald posted:Running random eval()s from the Interweb is a good idea c/d? Confirming because it's why the lucky stiff.
|
# ? Aug 9, 2007 14:26 |
|
bitprophet posted:I probably shouldn't even post in this thread, not having used Rails yet (started reading Ruby tutorials the other day, though, as my new job may have me doing some Rails work) but: how are the mentioned tools different from using e.g. Firebug or the Web Developer FF extension? They're different in that they run on the server. The way script console works, you get a line-by-line Ruby environment, where you can do anything you could do in a RoR page. I don't think I ever hit the database directly, once I started using that. You want to ban someone? User.find(4).ban Check the size of the posts table? Posts.find_all().length It's really goddamned useful for fixing models and controllers. Firebug is to CSS and HTML what Script console is to Ruby. Breakpoints are placed in the site code, in any model, view, or controller. When the code hits that line, it stops executing, and you get control over it in the console at that point. So if variables aren't displaying right or something, throw in a breakpoint, and see what the value is exactly at that point in the code. Seriously, the debugging tools are about the only reason I'd ever use Rails. bitprophet posted:(...and will I be the only RoR user who has a dislike for the David Hanssen style of "arrogance and overstatement is awesome" showmanship? ) No, that's actually a big turn-off for me, too. I kind of stopped reading the 37Signals blog after his little conference stunt. Basically, he did a talk about the future of Rails, and at the end, he said that if you don't like the way rails is going, gently caress you. Seriously, the last slide was just that.
|
# ? Aug 9, 2007 15:04 |
|
ANAmal.net posted:Basically, he did a talk about the future of Rails, and at the end, he said that if you don't like the way rails is going, gently caress you. Seriously, the last slide was just that. The thing with having someone like DHH as the face of Rails, you kinda only have to ignore the one megalomaniac. I'd probably prefer that to watching a few egos fighting for top dog. I just wish DHH would learn to say 'we' a little bit more often. It always appears like he's constantly taking credit for other people's work (ie. the recent Rails logo rant). You just gotta laugh! The next generation of Baby Boomers are here
|
# ? Aug 9, 2007 15:47 |
|
ryanmfw posted:You keep comparing apples and oranges. Ruby is not an MVC framework, just like PHP. RoR, and PHP along with the several well developed frameworks like CakePHP, Symfony, and CodeIgniter make MVC development easy. Ruby itself does not make it easier, just like PHP itself does not. This is exactly why I don't understand what the big deal about ruby is. Sure it has an "official" framework but other than that I don't see any benefits. Like that other dude said in his argument against perl, the only thing perl excels at compared to ruby is in performance and aesthetics(not sure I agree with that but I'll take it), but what else is there?. I just can't figure out a niche or function that Ruby/RoR fills for me as a developer.
|
# ? Aug 9, 2007 18:01 |
|
slobodan posted:The thing with having someone like DHH as the face of Rails, you kinda only have to ignore the one megalomaniac. I'd probably prefer that to watching a few egos fighting for top dog. I just wish DHH would learn to say 'we' a little bit more often. It always appears like he's constantly taking credit for other people's work (ie. the recent Rails logo rant). You just gotta laugh! The next generation of Baby Boomers are here He just comes off like a prick, is all I'm saying.
|
# ? Aug 9, 2007 18:16 |
|
legalcondom posted:I just can't figure out a niche or function that Ruby/RoR fills for me as a developer.
|
# ? Aug 9, 2007 18:19 |
|
slobodan posted:The thing with having someone like DHH as the face of Rails, you kinda only have to ignore the one megalomaniac. I'd probably prefer that to watching a few egos fighting for top dog. I just wish DHH would learn to say 'we' a little bit more often. It always appears like he's constantly taking credit for other people's work (ie. the recent Rails logo rant). You just gotta laugh! The next generation of Baby Boomers are here Its unfortunate that DHH is doing things the way he is, but alot of smart people are equating a languages popularity has a factor in its success. So is he a dick? yeah, but I think it might help rails in the long run. No press is bad press
|
# ? Aug 9, 2007 18:19 |
|
ANAmal.net posted:They're different in that they run on the server. Interesting. In Django you can use the Python shell to do the same things you just described, so in a general use-case ("let me modify object X or get a count of how many Y objects I have") it doesn't sound terribly unique. However, the ability to set breakpoints in a web development environment is nice; I'm sure there's an analogue in Python but it would probably require using Django's development runserver (similar to but not intended for real server use as Mongrel) and plenty of 'pdb' usage. I'll have to root around and see if anyone has thought of something like that for Django ANAmal.net posted:No, that's actually a big turn-off for me, too. I kind of stopped reading the 37Signals blog after his little conference stunt. Yea. I also found it telling that the copyright info on rubyonrails.org mentions David first and the community second: rubyonrails.org posted:Ruby on Rails was created by David Heinemeier Hansson It also mentions 37signals, but that makes sense, as few large open source projects can have decent development/marketing/hosting/etc without a genesis at a company - Django's is the Lawrence Journal-World, a Kansas newspaper, and it says so on the Django site. However, that's all that is mentioned there - the core development team tends to not care too much about getting their names out in the way that David does. That said, there's no question that David's marketing and personality have played a large part in getting Rails the mindshare it currently has, which is only a good thing for Web development as far as I'm concerned. The less people using regular code-soup PHP, even if it means they just move to a PHP MVC framework, the better.
|
# ? Aug 9, 2007 18:45 |
|
legalcondom posted:This is exactly why I don't understand what the big deal about ruby is.
|
# ? Aug 9, 2007 19:09 |
|
skidooer posted:In most popular web development languages you write a program. In Ruby you write programs that write programs. The latter lends itself very well to web development. The only problem I see is that these Ruby idioms usually are not apparent to the Ruby novice, so they end up writing PHP-like code, only with Ruby syntax, and fail to see what the big deal really is. This is the same with any framework, especially Ruby/Python ones: it's not just different syntax and different organization, it's different ways of thinking about the problems and approaches to solving them. I say "especially Ruby/Python" because those sorts of languages encourage doing things in an intelligent manner, both by virtue of what their syntax allows as well as the communities and tools surrounding them.
|
# ? Aug 9, 2007 19:24 |
|
legalcondom posted:This is exactly why I don't understand what the big deal about ruby is. Sure it has an "official" framework but other than that I don't see any benefits. I'm not sure what your point is; in one post you make a framework comparison and ask what's the buzz around Rails about, in the next you say you don't want a framework comparison and say anything Ruby can do Perl can do better. Ruby is a unix-oriented scripting language with a number of libraries built for it, and it combines a number of programming paradigms and clever language tricks and syntax in a way that many find elegant and usable. Perl, by contrast, is a unix-oriented scripting language with a number of libraries built for it, with a syntax that is nothing short of god awful. Much like Perl and PHP and Python, Ruby has no special domain where only it can ever be used. Also whatever database you're using must be pretty awesome if it knows how to automatically keep an updated age field
|
# ? Aug 10, 2007 01:03 |
|
take boat posted:Also whatever database you're using must be pretty awesome if it knows how to automatically keep an updated age field Umm, MSSQL and Oracle can both do this - I do think it's better that it's done by the business logic, but it's not exactly a way-out-there feature. Besides, it's trivial for any even vaguely OOP language to compute a fields value based on the value of other fields.
|
# ? Aug 10, 2007 02:14 |
|
take boat posted:Ruby is a unix-oriented scripting language with a number of libraries built for it, and it combines a number of programming paradigms and clever language tricks and syntax in a way that many find elegant and usable. Perl, by contrast, is a unix-oriented scripting language with a number of libraries built for it, with a syntax that is nothing short of god awful. Much like Perl and PHP and Python, Ruby has no special domain where only it can ever be used. Alright, that's all I wanted to know, it's just a preference in synax. I guess my issue is just that I'm used to perl, php and other languages that are similar. It's kind of difficult for me to pick up/use ruby because it's quite different and the approach is different than what I'm used to.
|
# ? Aug 10, 2007 02:35 |
|
enki42 posted:Umm, MSSQL and Oracle can both do this - I do think it's better that it's done by the business logic, but it's not exactly a way-out-there feature.
|
# ? Aug 10, 2007 04:03 |
|
take boat posted:Really? You can fake it in MySQL using views, I know, but do you mean they have an actual age field? I am not exactly up on databases though so either way would not surprise me. You can use stored procedures/triggers (also available in postgresql) to do this kind of stuff.
|
# ? Aug 10, 2007 04:27 |
|
legalcondom posted:Alright, that's all I wanted to know, it's just a preference in synax. I guess my issue is just that I'm used to perl, php and other languages that are similar. It's kind of difficult for me to pick up/use ruby because it's quite different and the approach is different than what I'm used to. I am actually in the same boat as you. However I fear being stagnant and not at least trying out the next new things. I feel like this with Ruby, as well as Flex and Silverlight technologies. However I think with syntax simplicity comes improved productivity and better maintainability. So there is some benefit to having a "lighter" syntax. Not even mentioning the forced MVC architecture. My issue now is more of how well does it integrate with web servers, that will overall effect my adaptation to it or not. I have always had an issue with deploying Java technology on a single server with both a web server and an app server, I know this isn't required but it seems to be the norm. Found these: http://www.modruby.net/en/ -- Apache http://made-of-stone.blogspot.com/2006/01/rails-on-iis-revisited.html -IIS I like this setup though much better than Tomcat or Websphere for example, although both are super powerful it would be nice to have a middle solution, much like I use PHP for now. The IIS one seems like a huge PITA which concerns me. Not that I am a huge fan of IIS but some of my clients are, anyone know a better way?
|
# ? Aug 10, 2007 05:07 |
|
take boat posted:Really? You can fake it in MySQL using views, I know, but do you mean they have an actual age field? I am not exactly up on databases though so either way would not surprise me. Not age specifically, but MSSQL and Oracle (I'm about 90% sure for oracle) have computed fields. Plus of course you can always use stuff like views.
|
# ? Aug 10, 2007 13:14 |
|
Roloc posted:The IIS one seems like a huge PITA which concerns me. Not that I am a huge fan of IIS but some of my clients are, anyone know a better way? That said I have a Rails app in production on a Windows server (internal app for the company I work for). I have Apache on the front proxying to mongrel for this one app, and proxying to IIS for the other apps on the server. It's not pretty but it works and the app gets low traffic so performance isn't really an issue.
|
# ? Aug 10, 2007 13:23 |
|
Hey, a rails question! so I'm trying to create a new model in my application. It's going to be a hobo model, which I've created in the past. For whatever reason, I can't get code:
It just outputs like this: code:
What am I doing wrong?
|
# ? Aug 10, 2007 16:18 |
|
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 |
|
The major reason Rails rocks for me is that it makes good practice easy. In fact a lot of the time it's harder to behave badly. You guys have already mentioned the MVC pattern support, but you also get things like: - Great testing support, automatic creation of functional and integration test skeletons. I'm currently investigating Selenium on Rails http://www.openqa.org/selenium-on-rails/ which looks like a good solution to getting front end tests automated as well :-) - Fixtures for generating test data - Support for multiple environments baked in - Migrations that make evolving databases easy I'm working on a large .Net project at the moment and one of the major frustrations I am have is that when you open Visual Studio you get a blank canvas. What happens when you get a blank canvas? You either: a) End up with a mass of developers with varying skill levels making their own little bit of the system in a particular style. This gives you a maintenance and integration nightmare. b) spend ages investigating and educating people about options for unit testing, deployment, system structure etc. etc. I'm happy that Rails (in a large subset of contexts) presents a complete environment for development that other so called 'Enterprise Strength' frameworks lack. This leaves me to concentrate on the important bits, i.e. fulfilling the requirements. I just wish I could persuade the senior people at my company that we're missing a trick by not using it more!
|
# ? Aug 10, 2007 17:25 |
|
vg8000 posted:The simple answer is don't use Rails on Windows in production. It really really sucks and very few people are doing anything about it. Thank you that probably saved me a few headaches. It is tough for me to buy into Ruby as a solution then because I have to be able to suggest stuff that works well on Windows since most of my business is with the State of California and they have been hard sold on .NET stuff. I am going to keep it in mind should a decent Linux contract come along.
|
# ? Aug 10, 2007 17:27 |
|
Scarboy posted:Why are you prefixing script\generate by rails? It should be ruby if anything. touche. It was supposed to be ruby. Brain fart, I guess. That fixed it!
|
# ? Aug 10, 2007 18:10 |
|
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 |
|
Scarboy posted:If I get no result how do I call ActiveRecords base method_missing to do whatever it has to do or raise exceptions? code:
|
# ? Aug 10, 2007 18:48 |
|
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 |
|
i just started using rails 6 months ago. I work at one small company that are foolish enough to pay me to work all day long learning/writing code for cad macros or the database. My app folder in my project is up to 1.56 megs worth of code, but I still don't know crap. My database looks pretty, goes fast, and uses all free software though so works happy. I haven't figured out how to sort some stuff though, like user_id qc_user_id they both link to the same user table so I can't figure out how to sort by qc_user's name instead of the integer. Whatever I'll get it someday. It's been in operation now for about 1.5 months with no major problems, other than importing the customer pricing wrong on the first day, but that was just a simple fix to the code and reimporting. I even use WIN32OLE to link up with access to print reports, haven't figured out how to make reports that are 2 or more records though, just 1 at a time now for the paperwork that goes through the shop. So I guess access isn't free, but the rest of the software is. I'm still pretty clueless on programming, but at least I can go from cad data file to a cnc file using a ruby script But the best part is i'm getting paid to learn basically, and I don't have to talk to customers anymore, hooray, I like ruby, and rails is cool too.
|
# ? Aug 10, 2007 19:28 |
|
Jackdonkey posted:Whatever I'll get it someday. code:
|
# ? Aug 10, 2007 19:43 |
|
I have a pretty serious question regarding rails log files in production. Every time a page is visited in your rails application there is a minimum of about 6 lines of information written about it to the log. Some plugins such as better_nested_set which is pretty drat well near necessary for some applications, there is a command that is going to be depreciated in an upcoming version of rails so you get about 30 or 40 (or however many rows of information are in your database) lines of text written to your log file, each one with a long description telling you about it. On a traffic heavy web site this log file will eventually get really big right? Isn't that bad? Regardless I want to turn it off. Thanks. vvvv Related to this is there a good place to figure out what environment.rb is not used for? Nolgthorn fucked around with this message at 20:28 on Aug 10, 2007 |
# ? Aug 10, 2007 20:04 |
|
Nolgthorn posted:
code:
|
# ? Aug 10, 2007 20:14 |
|
Sir Chicken Caesar posted:The major reason Rails rocks for me is that it makes good practice easy. In fact a lot of the time it's harder to behave badly. You guys have already mentioned the MVC pattern support, but you also get things like: For example, say you're trying to test a custom auto-complete field (like google suggest) - if you use the 'type' command you'll find that the form field gets a value but keyup/down/press events never get sent. If you send the events explicitly some browsers get both the event and fill in values while others only get the events (and some do neither). Now you have to test around browser problems, which also defeats part of the purpose for automated browser testing. Maintainability wisely, the problem is that you write your tests as a series of commands and tests with basically no modularity or logic to them. This is about as easy to extend and reuse as assembler. The hooks for targeting a particular element are inadequate (especially when trying to locate an element that was just inserted via AJAX and whose ID depends on the database in a hard to predict way) and you end up writing a lot of tests that depend on some insignificant UI detail. If that UI detail changes, test suddenly start failing and you have to re-write and debug a whole suite, wasting countless hours, for something that shouldn't even have affected the tests. God help you if you actually want to change the workflow of a handful of pages - you almost always have to re-write (and debug!) any tests that have anything to do with it, again, because of a complete lack of modularity. It's up to you to implement such modularity, but you'll find that the whole thing is just a real pain in the rear end to work with. In my experience, it's not worth the investment - not even close. quote:- Fixtures for generating test data quote:- Support for multiple environments baked in quote:- Migrations that make evolving databases easy Migrations are still really awesome otherwise, but man, they really have some glaring problems left in them that nobody seems interested in tackling. --- Yes Rails is all sorts of <3 and puppies, but there are more then a few things about it that make you want to run up a wall in anger when you have to deal with them.
|
# ? Aug 10, 2007 20:53 |
|
Mr. Wynand posted:Run away! Run as fast you can! It looks great but in practice the tests are a massive pain to write and maintain. The other problem is that it's often buggy, inconsistent across browsers and just plain not an accurate simulation of true user interaction. Have you tried looking at Selenium and Watir to do the type of testing your talking about? I'm personally not a big fan of that type of testing because the breakdowns usually occur on the model or controller level anyway, and like you said, it changes way too often to be of much value. Regarding testing not being worth the investment -- I have to say, I've seen some stupid things said about Rails, but that's the first time I've heard that one. I will admit it takes discipline and experience to do it correctly but it does pay off eventually and sometimes in spades. Mr. Wynand posted:Except a lot of code depends on "development", "test" and "production" explicitly. It shouldn't, but it very often does (plugins are especially bad at this - and face it - sooner or later an if RAILS_ENV=="development" is going to slip in your code somewhere...). So even though you can make your own enviornments in theory, in practice, it's a lot more headache then just swapping out prod/dev/test through some lovely hack for different deployment targets. This is crazy. Mr. Wynand posted:migrations You do know you can use ActiveRecord inside your migrations to do data manipulation/sanizations between migrations?
|
# ? Aug 10, 2007 21:19 |
|
Fork posted:
|
# ? Aug 10, 2007 21:22 |
|
vg8000 posted:Yeah but when you try to re-migrate from scratch, you're using [latest model] versus [older database migration] that may not be compatible anymore. He said this himself in his post. Ah oops. I misread what he was saying.
|
# ? Aug 10, 2007 21:25 |
|
|
# ? May 15, 2024 04:52 |
|
Speaking of all this migration business, how can I use rake db:migrate to just... add a field to a table? I'm still heavily developing my application, and I often find the need to add columns (as I develop features), and I don't want to have to wipe the contents of my db each time. Often rake db:migrate doesn't seem to do anything.
|
# ? Aug 10, 2007 21:29 |