|
Ruby on Rails (aka Rails) While I'm admittedly still an amateur web developer, I've been a professional programmer for years, and I've always dabbled in web development. I'm currently a senior at UConn, and I've been working on an independent study project with a professor to create a simple two tier web application (eventually for my own purposes; the project is catered to my interests). I started out the project using javascript/ajax/php/css/sql, and got a simple semblance of a working webapp up after a month or so. Adding functionality was slow going, in part because I was new to php, and because I'm a bit clumsy with debugging web applications in general. Well, I was reading some rogue post here in SH/SC, where some wise fella said something along the lines of "you'd never run into this problem if you were using rails, and it would have taken you 10x less time to get here". Well this prompted ol' mrsaturn to start reading. Rails? What is rails? Rails is really just a streamlined and simplified way to create web applications that are heavily database dependent. The syntax is simple, installation is a breeze, and it's got a decent learning curve. It can run on a windows machine or linux, as well as ol' Mac OSX. With Rails,
Resources
Applications that Use Rails Here's some sample apps that use rails (I don't own any of these, they're just to show how drat cool it is) Typo is a web blogging service Worth note I'm currently working on integrating Hobo into my application. Hobo is an application builder for rails. It's basically the easiest way to get a user interface (log in/log out, etc) into your pages without having to think about it, and it works. The development team for hobo is very responsive, and helpful to my newbie woes. It's also got great ajax stuff built in, like the ability to edit fields in a record on the fly, if you're the right user. Check out their screencasts. So yeah, I mean, I'm in love with rails. Use this thread for whatever you want - over it, ask for help, tout its abilities, or whatever you see fit. If y'all have working webapps that use rails, or want me to include them in the OP, let me know! MrSaturn fucked around with this message at 19:11 on Aug 8, 2007 |
# ¿ Aug 8, 2007 18:57 |
|
|
# ¿ Apr 29, 2024 04:28 |
|
Fixed the link, thanks =) Are there any experienced hobo users here? I'm currently filling up a thread in their dev forum because I can't get textile to work with it =/
|
# ¿ Aug 8, 2007 19:10 |
|
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 |
|
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 |
|
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 |
|
Ah, thanks! Regarding migrations, to the naysayers, seriously, look into hobo. this is coming in the next release!
|
# ¿ Aug 10, 2007 21:40 |
|
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 likephp:<? :User.find(House['user_id']) ?>
|
# ¿ Aug 15, 2007 18:46 |
|
where would I put :include=>user ? edit: see the problem here is I'm trying to set hobo's set_creator_attr to :User.find(venue['user_id']) and I'm getting a code:
php:<? set_creator_attr :User.find(venue['user_id']) ?> MrSaturn fucked around with this message at 19:26 on Aug 15, 2007 |
# ¿ Aug 15, 2007 19:23 |
|
Scarboy posted:Here's an example: well the problem with that call is that I'm in a room, and I have a valid reference to a house, but not to a user. so the :include => :user part wouldn't work, right?
|
# ¿ Aug 15, 2007 20:01 |
|
yeah, that's kinda like it, though the syntax is a bit different because of hobo. it turns out my problem was a mound of different things, but the eventual syntax is this: House.find(:first,:conditions=>[ "user_id = ?", user['user_id']]) out of curiosity, would I be better of replacing my belongs_to :user to a delegate? I've never used delegate.
|
# ¿ Aug 15, 2007 20:44 |
|
skidooer posted:You probably don't want to replace a belongs_to with a delegate, but it's hard to say for sure without seeing it in context. Well, a room really does only belong to a house, but hobo's user model makes it so that it verifies who can create what using user objects. This is such an odd specific problem, I really appreciate your help. I think I have it working decently for now, though. Thanks so much for your help, the hobo forums really weren't replying.
|
# ¿ Aug 15, 2007 21:44 |
|
I just broke something when I updated rails from the gem [to edge rails] and I can't figure on how to fix it.... here's what my error log shows:code:
|
# ¿ Sep 3, 2007 16:42 |
|
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 |
|
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 |
|
I'm very suddenly having a very odd problem. I'm running instant rails on vista, and as of last night, I can't start up mySql because code:
|
# ¿ Oct 10, 2007 23:26 |
|
IIS is definitely off. I just checked.
|
# ¿ Oct 11, 2007 04:30 |
|
maybe some of you rails gurus can help me with this. I'm running instant rails on a windows host machine, and I recently bought a domain name that i want to use to point to one of my rails apps. It's running on port 3002 locally (http://localhost:3002) and I just can't figure out how to reroute that to go to the default port (80 I suppose) that my domain will be referencing. I have the domain registered through mydomain, and I can get to the application if I go to the domain with a port extension on it (http://domain.com:3002) but http://domain.com doesn't work. I have a feeling that my ISP may block port 80 incoming, but I'm not sure. I subscribe to comcast cable, if that helps. What config do I have to edit to make this all work?
|
# ¿ Nov 14, 2007 07:05 |
|
So I've made this odd little blog type page for myself, just to experiment with some techniques I haven't yet used. I'm trying to use the scriptaculous stuff built into rails to show/hide the comments on a given post. Right now, all the comments for a post are in a code:
code:
The rjs file looks like this: code:
/front/showcomments/11 and it says code:
if you want to see the page, it's temporarily located at http://jivewise.livenode.com:3002/ (until I can get the port forwarding problems I talked about above sorted out)
|
# ¿ Nov 18, 2007 20:29 |
|
Hop Pocket posted:Funny, I was just working on the very same thing today. Really. I believe that you need to use a link_to_remote to force a JS request. That way your RJS template will be evaluated by the browser JS engine on return. The fact that you're using link_to means that it's generating an A tag that will force a page reload, which is not what you're wanting, I think. I'm getting closer... if I keep the comments_11 in the .rjs, I get these 2 errors when I click my link: code:
|
# ¿ Nov 18, 2007 20:57 |
|
Hop Pocket posted:It sounds like you may not have the javascript libraries loaded. In your <HEAD> tag in your layout or template, make sure you have: I've definitely got javascript loaded up. And i'm pretty sure the rjs template is invoked directly from the link_to_remote that I put in: code:
|
# ¿ Nov 18, 2007 21:16 |
|
Hop Pocket posted:
yeah, I wasn't. I'm trying to do it inline now. I'm going to use Element.toggle for now, until I can figure everything else out. Then I'll get fancy with scriptaculous
|
# ¿ Nov 18, 2007 21:57 |
|
Hop Pocket posted:If you've got the $25 bucks to spend, I'd really recommend the 'Agile Development With Rails' PDF available here. It helped me out with a lot of rails stuff. May help you, depending on where you are. it's sitting right next to me on my desk. I use it all the time, the only thing is I'm using the hobo plugin for my apps, which tends to add an element of complexity to my understanding the book. Great book, though, hands down.
|
# ¿ Nov 18, 2007 22:21 |
|
Ooooo got it working. Snazzy, eh? http://jivewise.livenode.com:3002/ ...now to let people add comments via ajax so they don't ever leave the frontpage...
|
# ¿ Nov 18, 2007 22:36 |
|
SeventySeven posted:I've got a controller set up like this: could you set a boolean value in method1 to true, so you know that when that value's true, it came from method 1? (then just reset it to false at the end of method 2)
|
# ¿ Nov 25, 2007 15:58 |
|
I've got another question: I'm trying to add an rss feed to my blog, but I'm missing something. In my blogposts controller, I added the following code (from http://paulsturgess.co.uk/articles/show/13-creating-an-rss-feed-in-ruby-on-rails):code:
What'm I doing wrong? I've restarted my servers, I've tried putting the def rss in the frontpage's controller and moving the accompanying rss.rxml file to that view folder, and nothing seems to fix this.
|
# ¿ Nov 26, 2007 03:02 |
|
ah I got it working now, I just set it up under a new controller. Is RSS a reserved controller name? if you want to see it, it's at http://puddl.es:3002/rssfeed This is pretty cool. I'm learning how to do about one new thing a week on rails, given the free time I have. I do rather enjoy all this. I think next I'm going to work on my display pages for each blogpost, then do some interesting ajax stuff. You guys are great help so far! Thanks!
|
# ¿ Nov 26, 2007 07:17 |
|
I suppose this is more of a linux question, but anyhow, I recently started running ubuntu on my laptop. Is there a way to run script/server in the background while I'm using the terminal? I'd like to be able to easily kill the process, too, but I'm not sure how to do that. Wait till you guys see my next little project -- I'm kinda proud of it. It's for a friend, and it looks spectacular.
|
# ¿ Dec 19, 2007 19:00 |
|
While we're at it, is there a way to do that in windows, or at least to group all of my command prompt windows together (perhaps in tabs)? I run 3 rails apps on my desktop, and they can clutter up my startbar.
|
# ¿ Dec 19, 2007 20:14 |
|
I use a plugin that uses the old style pagination, which has apparently been deprecated now with 2.0's release: http://api.rubyonrails.com/classes/ActionController/Pagination.html I can't seem to get classic_pagination to install using gems or the direct install command given on that page, so I want to update the plugin to use the new pagination. How do I reference pagination in it's new package? the old code looks like this code:
|
# ¿ Dec 22, 2007 02:21 |
|
bmoyles posted:Someone pissed in Zed Shaw's cheerios lord, what the devil is he on about? poor guy, lovely people ruined something that could have done him well, it looks like.
|
# ¿ Jan 3, 2008 23:56 |
|
Ok, so I made the plunge and bought some hosting on dreamhost. I've moved one of my rails applications over, but I don't know how to tell it to run on the default port for my domain. Essentially, at the moment you can access it at http://puddl.es:3000 but I just want to be able to get to it from http://puddl.es how do I do that? I've tried to do ruby script/server -p 80, but that doesn't work (it tells me I have permission denied on Bind())
|
# ¿ Jan 8, 2008 14:33 |
|
Austria posted:DreamHost is a terrible Rails host. I guess what I want to know is how do I set up my .htaccess to default to that running application... if I point to public/dispatch.fcgi nothing ever loads.
|
# ¿ Jan 8, 2008 18:43 |
|
Anal Wink posted:I've used acts_as_solr before. What's the difference between ferret ad acts_as_solr? They both use lucene if I'm not mistaken. problem is, mongrel isn't an installed gem, and they didn't allow me to run a daemon task with just ruby script/server -d, I don't think it'll work with mongrel either...
|
# ¿ Jan 8, 2008 22:16 |
|
Zaxxon posted:I'm a total newb to web programming in general, and I wanted to get started with Ruby on Rails, but every tutorial I read kind of comes from the assumption that a person will allready know a lot about web programming. They all have this "see with PHP it would be super hard to integrate your .xml file and your .wtf" but in rails all you do is edit Blah.rhtml, and then put a tag in your Db.yml file, and I have no idea what the gently caress any of this poo poo is. Well, if you're not familiar with html and css to begin with, I'd recommend you at least go through the tutorials at https://www.w3schools.org. Failing that, look up an article called "Rolling with ruby on rails". That's where I started.
|
# ¿ Jan 18, 2008 01:09 |
|
|
# ¿ Apr 29, 2024 04:28 |
|
I still use hobo a good bit, but the change to rails 2.0 kinda broke all of my applications, for one reason or another, so I had to start from scratch with a lot of things. I really need to set up subversion.
|
# ¿ Feb 19, 2008 16:32 |