I'm trying out Aptana+RadRails for a project, and I'm curious. autotest works fine when saving the actual models/views/controllers, but won't activate if I save a test file. Is there any way to get autotest to run a file in /test/ when it gets saved?
|
|
# ? Sep 3, 2007 22:06 |
|
|
# ? May 8, 2024 05:18 |
And another question - how the hell do you deploy to a subdomain? I've tried installing Typo to blog.mysite.com. So I'd have something like ~/sites/blog.mysite.com/public symlinked to ~/public_html/blog and a subdomain created which points to that directory. First I had to figure out the trailing slash problem (the difference between mysite.com/blog/ and mysite.com/blog) but now that that's working, going to blog.mysite.com doesn't work at all. There's got to be a way to fix this without resorting to site-specific routing stuff, right?
|
|
# ? Sep 5, 2007 15:13 |
|
Chiming in to say that I'm quite experienced with Ruby and Rails after working with it full time for the last year, so I'll gladly answer any questions anyone might have. My project is a web-based role playing game based on Internet culture. It's got over 100 models and uses a lot of awesome Ruby meta-programming tricks. It uses Haml for the templates and Sass for the stylesheets. shopvac4christ posted:I've tried installing Typo to blog.mysite.com. So I'd have something like ~/sites/blog.mysite.com/public symlinked to ~/public_html/blog and a subdomain created which points to that directory. First I had to figure out the trailing slash problem (the difference between mysite.com/blog/ and mysite.com/blog) but now that that's working, going to blog.mysite.com doesn't work at all. There's got to be a way to fix this without resorting to site-specific routing stuff, right? What web server are you using? Because deployment changes drastically depending on this. For example, in Apache2 I'd set up a NamedVirtualHost to whatever directory you're running your Typo install out of (forget the symlink).
|
# ? Sep 5, 2007 15:57 |
Grob posted:Chiming in to say that I'm quite experienced with Ruby and Rails after working with it full time for the last year, so I'll gladly answer any questions anyone might have. My host (Site5) is using Apache, but I'm not sure how much control I have over it. EDIT: Yeah, I can only edit .htaccesses. HIERARCHY OF WEEDZ fucked around with this message at 16:22 on Sep 5, 2007 |
|
# ? Sep 5, 2007 16:09 |
|
shopvac4christ posted:My host (Site5) is using Apache, but I'm not sure how much control I have over it. Unfortunately controlling what subdomains point to where is really a web server configuration issue, nothing specific to rails. If you can't touch Apache's configuration files, it will probably involve some hackery outside of rails to get it to work.
|
# ? Sep 5, 2007 16:22 |
How would one deploy a common library to all sites on a server? I ask the question this way because I'm coming from ASP.NET, where if we updated something in a global utilities library, we could just copy the DLL to separate projects, or even better, import it server-wide. I'm guessing it has something to do with plugins and maybe using capistrano to update the plugins for each site in a special deployment, but beyond that I wouldn't have any ideas.
|
|
# ? Sep 7, 2007 19:14 |
|
shopvac4christ posted:How would one deploy a common library to all sites on a server? I ask the question this way because I'm coming from ASP.NET, where if we updated something in a global utilities library, we could just copy the DLL to separate projects, or even better, import it server-wide. I'm guessing it has something to do with plugins and maybe using capistrano to update the plugins for each site in a special deployment, but beyond that I wouldn't have any ideas. Either the same plugin copied to each site, or if possible build a gem and install that on the system for all the apps to use.
|
# ? Sep 7, 2007 20:21 |
|
shopvac4christ posted:How would one deploy a common library to all sites on a server? I ask the question this way because I'm coming from ASP.NET, where if we updated something in a global utilities library, we could just copy the DLL to separate projects, or even better, import it server-wide. I'm guessing it has something to do with plugins and maybe using capistrano to update the plugins for each site in a special deployment, but beyond that I wouldn't have any ideas. One of the great features of Subversion (which I assume you're using because you mentioned capistrano) is the ability to have externals. An external is the ability to point part of your source tree at another source tree altogether. What I would do in this case is build a new tree for your plugin, then put it as an external in the plugins directory of each project. Then, whenever you do a svn update (through capistrano or local, whatever) you'll get the latest stable version of your plugin. I'm on edge rails right now, and I have my vendor/rails directory set up as a svn external. Every time I do a svn update, it grabs the latest version of rails for me, which is awesome. I also do it for Haml.
|
# ? Sep 8, 2007 18:46 |
|
Grob posted:One of the great features of Subversion (which I assume you're using because you mentioned capistrano) is the ability to have externals. An external is the ability to point part of your source tree at another source tree altogether. SVN externals can sometimes be a royal pain in the rear end. An excellent alternative is Piston (http://piston.rubyforge.org/). You can even use this to maintain your own specific changes to a plugin while also maintaining updates upstream.
|
# ? Sep 8, 2007 19:21 |
|
Is there an easy, lightweight, but most of all SECURE plugin or library to use for user authentication? I'm trying to integrate restful_authentication as the user/sessions manager for my app but it just keeps giving me problem after problem, and honestly I'm not too familiar with the way Rails works yet so I really don't know how to fix an error that's caused by the README telling me to put a line of code in a file. This is the only qualm I have about Rails. Kids, if you're trying to learn Rails be prepared for shitloads of blackbox code. If you download a plugin and it doesn't work, and you aren't very fluent with Ruby/Rails conventions yet, tough poo poo. I'd love to use restful but every time I fix a problem it creates new ones.
|
# ? Sep 8, 2007 20:41 |
|
brb buddy posted:restful_authentication OK I am really starting to wonder what the hell. I decided to look up how this REST crap goes with logging in, since session cookies are EVIL. I came up with: http://www.berenddeboer.net/rest/authentication.html what. the. hell. It's pages long and , and I don't get what all that effort really gets you. Less flexibility and more regular expressions, hey my two favorite things in the whole wide world! Seriously it's like Ruby on Rails made web development too easy so someone dragged out a quote by Tim Berners-Lee or whomever the hell from 1996 and made a "what if" game to play while coding RoR applications. "What if all the cool new features of modern browsers to make up for the lovely statelessness of the original HTTP1.0 were REMOVED and we COULDN'T USE THEM?" Because developing web applications just isn't a huge enough timesink, I guess we need to triple our effort and put arbitrary limitations on which standard web browser features we can use. Awesome. Also, no verbs. If someone wants to waste their time on this crap, knock yourself out, I guess. I'll be over here making stuff that works and just worrying about the normal lovely timesinks involved in web dev, like cross-browser CSS compliance and having the w3c inspector not poo poo bricks when I send my site through it to please some dude in IRC who swears my problems with something unrelated has to do with not using & for link strings with an ampersand in them. Space Kimchi fucked around with this message at 22:39 on Sep 8, 2007 |
# ? Sep 8, 2007 22:37 |
|
Space Kimchi posted:If someone wants to waste their time on this crap, knock yourself out, I guess. I'll be over here making stuff that works and just worrying about the normal lovely timesinks involved in web dev, like cross-browser CSS compliance and having the w3c inspector not poo poo bricks when I send my site through it to please some dude in IRC who swears my problems with something unrelated has to do with not using & for link strings with an ampersand in them. It's interesting, because most web developers I know just "get" the basics of rails (activerecord, controllers, views, rjs) when they first see it. The way it's organized and does the database handling is pretty intuitive. I can't say the same for the REST stuff. It's often a head scratcher -- like why would I bother to do all that extra work when the end product is the same? There is an advantage though, it's about organization. One of the best things about a rails app is if you need to debug it, you know exactly what file to go to in what directory, since they're all organized the same way. The REST stuff takes it a little further, in that it names the majority of your controllers and their methods for you. You always call the same methods to insert, update, delete, etc. Additionally, you get a lot of cool "black magic" for finding the paths of things.
|
# ? Sep 8, 2007 23:16 |
|
Space Kimchi posted:"What if all the cool new features of modern browsers to make up for the lovely statelessness of the original HTTP1.0 were REMOVED and we COULDN'T USE THEM?" Because developing web applications just isn't a huge enough timesink, I guess we need to triple our effort and put arbitrary limitations on which standard web browser features we can use. Awesome. Also, no verbs. Statelessness isn't pointless. The most obvious benefit of REST is that it helps sites scale; you can farm out a site to many servers without having to worry about them sharing session data, and it makes your site more cacheable. HTTP is stateless by design, not because they couldn't have come up with something better. Also, RESTful authentication would be easy (even easier than session-based) if browsers would just get their acts together and put a decent interface on HTTP authentication.
|
# ? Sep 9, 2007 01:49 |
|
I really don't care about using REST, as I don't even really know (or care to know at this point) what it is. I just want a simple way to authenticate multiple users, and restful_authentication does this with a method (logged_in? I believe it is). So basically I call that method and that's my security check. It's also got e-mail account activation, and it's scalable. I want a plugin to do that, if not I'll have to waste a lot of time learning how Rails handles cookies and sessions, and while that seems like an interesting future project I'd prefer if the user system would just work now. And Railscasts sucks, making it seem like it's easy as pie to get this plugin to work...It's not, the plugin doesn't loving work as intended.
|
# ? Sep 9, 2007 02:17 |
|
I'm using RoR to commercialize web app version of a traditional rich client app. I've been learning as I go. It's been all roses except for a few times where convention/language immaturity has hosed me. I'd sure love some more thorough documentation, that's for sure. One obscure but confusing pitfall: Rake is just a ruby gem. Due to this, it also seems to suffer from documented problems if you use various "reserved words" (not mentioned anywhere, just stuff that crosses over with a few rake methods). I didn't think this would be the case due to the separate namespaces but it seems I'm wrong. I was creating some randomly generated sample data in a rake migration file for performance testing, and I spent an hour trying to work out what I was loving up. Turns out having validates_presence_of :task creates a conflict, due to the use of task in Rake. I don't fully understand how this conflict occurs, but apparently there are a handful of other words/symbols that can't be used when raking.
|
# ? Sep 9, 2007 03:33 |
|
Space Kimchi posted:HTTP rant Amen, brother. HTTP has to be the worst thing to happen to application development in a long, long time. Don't get me wrong - as a protocol for retrieving documents, and nothing else, it's ok, I guess. As a general-purpose protocol which acts as the foundation for all our future application development? Oh. My. God. After all the crap that was added to correct some of its deficiencies in this regard, all we have is a whole bunch of ill-defined standards, and programmers having to code around the various bugs in IE's implementation of them. Sometimes I wish we could just take a step back, and come up with something better. Fat chance.
|
# ? Sep 9, 2007 04:15 |
|
Some good replies here about REST, and I'm glad there's nobody being an insane zealot about it and having a rational discussion. Times like this it makes the $10 (times how ever many times I've been banned and bought/rebought features ) so worth it And yeah the statelessness of HTTP is why it became popular in a way. It's just less resources and easy to set up, but I think in applications. You just can't have an application without states, it's impossible. REST is great for like blogs and wikis and stuff but I'm interested in interactive web applocations, and awesome uses of AJAX. Some things just have to be verbed, and some things just have to have states. When I have time to blow on doing more RoR I'm basically trying to make a multi-user game that is played over a web interface. There are enough challenges without worrying about REST. I see the value in developing large apps but ugh, still. HTTP authentication makes your site look like it's a piece of poo poo from 1994. If they find ways to make REST a natural-feeling part of Rails I won't complain, but only if it does't make me have to hack stuff to get it to work. In the meantime, I like my verbs and session cookies.
|
# ? Sep 11, 2007 03:57 |
|
Space Kimchi posted:Some good replies here about REST, and I'm glad there's nobody being an insane zealot about it and having a rational discussion. Times like this it makes the $10 (times how ever many times I've been banned and bought/rebought features ) so worth it Hey, I wish there was a well-deployed stateful protocol too; then you could do things your way and I'd do them my way and it would become pretty obvious what architecture's better for what kind of problem, and application designers could focus on their applications instead of hacking around protocol design decisions, and protocol designers could focus on solving specific problems instead of defending their design decisions. quote:And yeah the statelessness of HTTP is why it became popular in a way. It's just less resources and easy to set up, but I think in applications. You just can't have an application without states, it's impossible. The trick is to keep the state on the client side; AJAX actually makes this very easy. quote:HTTP authentication makes your site look like it's a piece of poo poo from 1994. It's a damned shame; blame the browsers. Have you taken a look at continuation-based web frameworks like Seaside at all? Seems like it would be right up your alley.
|
# ? Sep 11, 2007 04:26 |
|
Al Azif posted:The trick is to keep the state on the client side; AJAX actually makes this very easy. Yeah well, you know what they say about clients and how much you can trust them. I've never really had issues with cookie authentication because it's relatively hack-proof. Aside from people somehow getting other people's session cookies (if they can there are usually much more serious problems to work with, and you can do things like tying them to IP addresses if you REALLY need something secure) you can't tamper with individual data items. If you're doing some kind of online game, this is ideal. You want the game to handle any logic or transactional things, NOT the client. See: any Korean MMORPG ever made. What I have in mind for my project is something like at http://vse.marketwatch.com though with some important differences. The details are secret for now, as I am no John Romero and I'm not sure if this thing is ever even going to get made yet, but needless to say there will be lots of privately generated pages that aren't public, and will update frequently, and just won't work well in a REST situation. You don't WANT to be able to copy and paste URLs from some parts and expect things to work. I'll look at REST when I want to create Wordpress on Rails or whatever because we don't have enough blogging platforms, but for a game?
|
# ? Sep 11, 2007 09:00 |
|
brb buddy posted:I really don't care about using REST, as I don't even really know (or care to know at this point) what it is. I just want a simple way to authenticate multiple users, and restful_authentication does this with a method (logged_in? I believe it is). So basically I call that method and that's my security check. It's also got e-mail account activation, and it's scalable. I want a plugin to do that, if not I'll have to waste a lot of time learning how Rails handles cookies and sessions, and while that seems like an interesting future project I'd prefer if the user system would just work now. brb buddy posted:And Railscasts sucks, making it seem like it's easy as pie to get this plugin to work...It's not, the plugin doesn't loving work as intended.
|
# ? Sep 11, 2007 14:06 |
|
I need to create a very simple web app: - A "Team" which contains main contact information - A "Participant" which contains a particular person The Team has_many participants and the participant belongs_to Team It's a simple one-to-many relationship All I really need the app to do is add those together as one step. i.e. Create a team and add the participants. So far what's stopping me is how to implement the one-to-many in Rails. Does anyone have a sample application that implements a one-to-many and has views that allow them to be created at once? Should I be combining the two above into one Model? Or should they be two separate models with a single controller?
|
# ? Sep 11, 2007 14:30 |
|
roop posted:Does anyone have a sample application that implements a one-to-many and has views that allow them to be created at once? Should I be combining the two above into one Model? Or should they be two separate models with a single controller?
|
# ? Sep 11, 2007 14:35 |
|
roop posted:Should I be combining the two above into one Model? code:
code:
code:
skidooer fucked around with this message at 15:16 on Sep 11, 2007 |
# ? Sep 11, 2007 14:59 |
|
Thanks, after quite a bit of trial and error I've got it functional. Now to make it usable with the magic of error handling and stylesheets
|
# ? Sep 12, 2007 05:52 |
Ambition is getting more awesome:quote:Ambition has gone from generating generic SQL to respecting your database of choice (as long as it’s MySQL or PostgreSQL). [...] And because Postgres supports case insensitive regular expressions, so do we: And some vague benchmarks: code:
|
|
# ? Sep 12, 2007 13:52 |
|
This is a question so stupid, I can't believe I'm asking it, but: how do I link to a static page within my domain? I want to make a contact page for my application, but there's no dynamic content to be put on it. I tried making app/views/contact/index.rhtml, and I got a routing error when I pointed my browser there. where do I put a page to link to, say localhost:3000/contact?
|
# ? Sep 13, 2007 22:10 |
|
it goes in /public
|
# ? Sep 13, 2007 22:46 |
|
atastypie posted:it goes in /public does it go as /public/info.rhtml or /public/info/index.rhtml? I'm not really getting either to work.
|
# ? Sep 13, 2007 22:55 |
|
MrSaturn posted:does it go as /public/info.rhtml /public/contact.html The URL for this should end up like this: http://example.com/contact.html If you wanted some dynamic stuff on the page you'll have to make a new controller/view.
|
# ? Sep 13, 2007 23:03 |
|
MrSaturn posted:This is a question so stupid, I can't believe I'm asking it, but: If it's purely static, you can put it in public as people have mentioned, but if you want to do stuff like use layouts, an easy way to do it is to create a controller script/generate Controller contact The controlller doesn't need any methods. Even without actions defined it'll look for the view for whatever file you request, so your above url/file should work. I suspect you got the routing error due to not having a contact controller.
|
# ? Sep 14, 2007 04:32 |
|
Disclaimer: Very new to RoR. I've been building a small project recently and have been using migrations to build my database since apparently it's the best way to do it (?) and I'm trying to get used to The Rails Way. I realized that a migration I just created to change a field was pretty stupid so I wanted to roll back to the version beforehand. Of course, being the idiot that I am I just had to write this code... code:
|
# ? Sep 24, 2007 06:24 |
|
SeventySeven posted:Disclaimer: Very new to RoR. In the process of scoping out the model/database design for my latest project, I've hosed up my migration files a bunch of times through having them abort half way (and leave a table), thanks to mispelling table names etc. Load up mysql, drop the database, create it, run "rake db:migrate" on the now empty database. There are a variety of ways to get around your situation, but I don't think it's worth the effort. I just fix it up, then go from scratch. For me, sometimes rake just starts flaking out for both increasing and decreasing the database version. It runs, doesn't do anything, and doesn't create any output. Again, I just clear out the database and go from scratch. Reality is, rake is an awesome but buggy/immature tool. Edit: Oh, and assuming this is a pre-production system. Don't bother creating separate migration files for an alter column. It's easier to migrate back to version 0, change the table declaration to include the column, and rake it back to the latest version. Before you actually push the system live, the practice is to group all the migration files together into a single file (not including sample/starting data if you have any). Ideally there's a migration file for each version of the system that gets pushed into production, having separate migration files for development is just a temporary measure. Hammertime fucked around with this message at 09:51 on Sep 24, 2007 |
# ? Sep 24, 2007 09:45 |
|
SeventySeven posted:Disclaimer: Very new to RoR. What was the column before hand? Were you just adding the constraint?
|
# ? Sep 24, 2007 10:30 |
|
I develop in Seaside. For you people talking about state take a look at it, it will blow your mind.
|
# ? Sep 24, 2007 10:55 |
|
Hammertime posted:Oh, and assuming this is a pre-production system. Don't bother creating separate migration files for an alter column. It's easier to migrate back to version 0, change the table declaration to include the column, and rake it back to the latest version. Before you actually push the system live, the practice is to group all the migration files together into a single file (not including sample/starting data if you have any). Ideally there's a migration file for each version of the system that gets pushed into production, having separate migration files for development is just a temporary measure. This can actually be dangerous unless you are the only person working on the project. If multiple people are checking out your source, going back and editing earlier revisions is sure to ruin their day Just a warning for the new guys.
|
# ? Sep 24, 2007 15:01 |
|
Grob posted:This can actually be dangerous unless you are the only person working on the project. If multiple people are checking out your source, going back and editing earlier revisions is sure to ruin their day Just a warning for the new guys. Very wise words. My prototype was a 1-man show. It's only now scaling up to a small project team(3ish devs). I do believe it's worth consolidating the migrations assuming you communicate it with other team members and make sure everyone has their work checked in. You remind me of how I dislike working with version control in RoR I find the generators in ruby just make it more awkward to add all the new files to subversion. If only there was some magical versioning solution.
|
# ? Sep 24, 2007 16:56 |
|
Hammertime posted:
code:
|
# ? Sep 24, 2007 17:41 |
|
Hammertime posted:Oh, and assuming this is a pre-production system. Don't bother creating separate migration files for an alter column. It's easier to migrate back to version 0, change the table declaration to include the column, and rake it back to the latest version. Before you actually push the system live, the practice is to group all the migration files together into a single file (not including sample/starting data if you have any). Ideally there's a migration file for each version of the system that gets pushed into production, having separate migration files for development is just a temporary measure. Okay, I'll probably just futz around with it to get it back to normal, since this is only development, not production. jonnii posted:What was the column before hand? Were you just adding the constraint? I changed it from :date to :datetime and added the default value. Neither were necessary. Grob posted:This can actually be dangerous unless you are the only person working on the project. If multiple people are checking out your source, going back and editing earlier revisions is sure to ruin their day Just a warning for the new guys. Duly noted. This is currently just a personal project without source control but I'd like to add another developer or two and SVN if this ever sees the light of day.
|
# ? Sep 24, 2007 18:09 |
|
vg8000 posted:
... ... I had no idea, thankyou.
|
# ? Sep 25, 2007 01:15 |
|
|
# ? May 8, 2024 05:18 |
|
"./script/generate X foo -c" will add it to SVN as well, if you like saving three keystrokes v:)v
|
# ? Sep 30, 2007 00:32 |