|
If I were building a webapp to keep track of artists and albums, and wanted to make a page for users to be able to keep track of what albums that have (and things like condition of album, and if it's vinyl, cd, etc) would Ruby be a place to start? Basically a database of artists, a database of albums that correspond to artists, and a collection page listing a user's actual albums held.
|
# ? Nov 8, 2012 00:31 |
|
|
# ? May 30, 2024 04:02 |
|
raej posted:If I were building a webapp to keep track of artists and albums, and wanted to make a page for users to be able to keep track of what albums that have (and things like condition of album, and if it's vinyl, cd, etc) would Ruby be a place to start?
|
# ? Nov 8, 2012 01:04 |
|
Cock Democracy posted:You're going to want to use Ruby on Rails, not just Ruby itself. Most people recommend learning Ruby first before diving into Rails, but I didn't go this route and learned them both at the same time. If you have any familiarity with other kinds of programming and web development going into it, I think that helps a lot. Good luck! I guess I need to learn the lingo as well. I thought I could use Ruby and it was known it was Ruby/Rails. I checked out Hobo as well, and watching their screencast was inspiring. I have a few years of web development under my belt with fixing client sites and jamming poo poo together to make wordpress sites, but it looks like this is an entirely different beast.
|
# ? Nov 8, 2012 01:09 |
|
Lexicon posted:I'm building a rails app which will be hosted on Heroku and pulls data from an RDS MySql connection. Note that this connection is in addition to the Postgres connection to the database that's the persistence layer for the rails app itself. You can use the URI stdlib Ruby code:
|
# ? Nov 8, 2012 03:37 |
|
Pardot posted:You can use the URI stdlib Worked perfectly. Thanks!
|
# ? Nov 8, 2012 18:09 |
|
Just noticed that the mysql gem returns everything as strings (or nil). Why do I have to deal with this kind of crap. Wish I could use PostgreSQL at our shop
|
# ? Nov 8, 2012 21:43 |
Smol posted:Just noticed that the mysql gem returns everything as strings (or nil). Why do I have to deal with this kind of crap. If you have a choice you could try using the Sequel gem that's been posted about in this thread like 20 times. It gives you a little ORM to work with if that's your thing.
|
|
# ? Nov 8, 2012 22:09 |
|
It's a Rails 2.3 app so we're using ActiveRecord where possible. In this case though, the queries I'm building are quite complex and the older versions of ActiveRecord aren't really up to the task (the Arel versions should be fine). ActiveRecord is pretty slow as well, and I really don't want the overhead of ActiveRecord here (we're pulling a quite lot of data from the database and I've measured ActiveRecord to have up to 20x overhead compared to plain Ruby Hashes in the past). I could replace mysql with mysql2, but the test coverage in this project is not really satisfactory, so I'm pretty hesitant to make large changes like that. Anyhow, I guess the real story is that good test suite is invaluable. Smol fucked around with this message at 22:47 on Nov 8, 2012 |
# ? Nov 8, 2012 22:38 |
|
Sorry if this has been asked before but I didn't catch it while skimming the thread: Is there a decent ERB reference or cheat sheet out there? Google is coming up dry. I've been playing with Sinatra and DataMapper and find I'm stumbling a little bit on making forms that interact with my Ruby code.
|
# ? Nov 10, 2012 01:18 |
|
fidel sarcastro posted:Is there a decent ERB reference or cheat sheet out there? Google is coming up dry. I've been playing with Sinatra and DataMapper and find I'm stumbling a little bit on making forms that interact with my Ruby code. ERB is pretty simple(and gets out of your way without being obtuse like HAML) but this is probably the best: http://ruby-doc.org/stdlib-1.9.3/libdoc/erb/rdoc/ERB.html
|
# ? Nov 10, 2012 01:36 |
|
Obsurveyor posted:ERB is pretty simple(and gets out of your way without being obtuse like HAML) but this is probably the best: Thanks! It never even occurred to me that the Ruby documentation would cover ERB.
|
# ? Nov 10, 2012 01:42 |
|
Good God installing Ruby/Rails/Phusion Passenger on a Linux cPanel server without taking over the entire virtual host was a nightmare. I feel like RVM complicated things even further. The good news is I finally got it working http://www.pluswebhost.com/rails/ Maybe I'll write up a tutorial for other developers who want to run it all on their own existing server. All the information is out there, but it's definitely not all in one place. Quick question: How do I change what environment I'm working with? Rails I'm fairly certain started the configuration on production. Thanks!
|
# ? Nov 12, 2012 09:16 |
|
Knyteguy posted:Good God installing Ruby/Rails/Phusion Passenger on a Linux cPanel server without taking over the entire virtual host was a nightmare. I feel like RVM complicated things even further. Set the environment variable RAILS_ENV to whatever (development, production, etc)
|
# ? Nov 12, 2012 09:49 |
|
MrDoDo posted:Set the environment variable RAILS_ENV to whatever (development, production, etc) Thanks for the help. So would this be correct? rake RAILS_ENV=development ? Also if anyone could lend a hand... I'm having some problems with a 500 server error. It's when I try to enter some information to the database. Website with error: http://www.pluswebhost.com/rails/posts (hit new post, and try to create) Code: https://github.com/Noppadet/RailsBasicApp Git isn't fetching the sqlite3 files that are present on my development server but I'm guessing that's just a driver? Still really new to the ROR stuff. Thanks . E: Rails logs aren't showing anything out of the ordinary. Could it be chown rights? Knyteguy fucked around with this message at 00:00 on Nov 13, 2012 |
# ? Nov 12, 2012 23:57 |
Knyteguy posted:Git isn't fetching the sqlite3 files that are present on my development server but I'm guessing that's just a driver? Still really new to the ROR stuff. https://github.com/Noppadet/RailsBasicApp/blob/master/.gitignore#L11 You should have different databases for development, testing and production anyway.
|
|
# ? Nov 13, 2012 00:43 |
|
Knyteguy posted:Thanks for the help. So would this be correct? rake RAILS_ENV=development ? You can specify the env on each command run or you can just export RAILS_ENV and every subsequent command will use that same one
|
# ? Nov 13, 2012 00:48 |
|
How do I get a list of all the variables available in a view? Things like the local variables and params?
|
# ? Nov 13, 2012 20:21 |
|
Physical posted:How do I get a list of all the variables available in a view? Things like the local variables and params? You can always do a params.inspect to dump out all the params in your view as for local variables are you referring to helper methods or the instance variables you define in your controller actions?
|
# ? Nov 13, 2012 20:37 |
|
Knyteguy posted:Good God installing Ruby/Rails/Phusion Passenger on a Linux cPanel server without taking over the entire virtual host was a nightmare. I feel like RVM complicated things even further. I would actually really, really appreciate it if you did did this.
|
# ? Nov 13, 2012 20:40 |
|
jetviper21 posted:You can always do a params.inspect to dump out all the params in your view as for local variables are you referring to helper methods or the instance variables you define in your controller actions? For instance variables, try: http://rubydoc.info/stdlib/core/Object#instance_variables-instance_method
|
# ? Nov 13, 2012 20:42 |
|
jetviper21 posted:You can always do a params.inspect to dump out all the params in your view as for local variables are you referring to helper methods or the instance variables you define in your controller actions?
|
# ? Nov 13, 2012 20:57 |
|
Physical posted:Instance variables in the controllers, including the ones with no @ symbol and the stuff you can pass in via render "partial", :locals => {} I want to inspect the :locals hash too. They should show up if you do a print out a methods.inspect if I am looking at this correctly: https://github.com/rails/rails/blob/0d3d9a150a4ba1084cf28fd26be2a154f4540952/actionpack/lib/action_view/template.rb#L305-307 or if that doesn't work you can always get them from the binder object code:
jetviper21 fucked around with this message at 21:15 on Nov 13, 2012 |
# ? Nov 13, 2012 21:10 |
|
Knyteguy posted:Good God installing Ruby/Rails/Phusion Passenger on a Linux cPanel server without taking over the entire virtual host was a nightmare. I am interested in your reasons for going this route.
|
# ? Nov 13, 2012 23:30 |
Does CPanel even support Rails 3?
|
|
# ? Nov 14, 2012 00:27 |
|
Pardot posted:I am interested in your reasons for going this route. Probably a carbon monoxide leak or brain cancer, if I ever touch cpanel again it will be too soon. Rack and Rails have simply moved faster and in different ways than cpanel can keep up with, even without adding the broken jankiness of rvm into the mix.
|
# ? Nov 14, 2012 02:14 |
|
Physical posted:How do I get a list of all the variables available in a view? Things like the local variables and params? What are you trying to do with this?
|
# ? Nov 14, 2012 02:14 |
|
A MIRACLE posted:Does CPanel even support Rails 3? Officially there is no easy plugin or update to allow Rails 3 to work on a cPanel server, no. This is only because Mongrel still doesn't work with Rails 3 (according to cPanel). There have been some requests to change the environment in cPanel to something better supported, but there hasn't been any visible progress by cPanel yet. quote:I am interested in your reasons for going this route. Path of least resistance I guess. Some people on the cPanel forums mentioned that mod_rails worked so that's what I went with. quote:I would actually really, really appreciate it if you did did this. Alright when I get some time to figure out the 500 error I'm getting on database writing I'll write up a tutorial. quote:You can specify the env on each command run or you can just export RAILS_ENV and every subsequent command will use that same one Thanks managed to make the setting stick now. E: Got the 500 error fixed, it was simply chown permissions Knyteguy fucked around with this message at 03:31 on Nov 14, 2012 |
# ? Nov 14, 2012 02:27 |
Knyteguy posted:Officially there is no easy plugin or update to allow Rails 3 to work on a cPanel server, no. This is only because Mongrel still doesn't work with Rails 3 (according to cPanel). There have been some requests to change the environment in cPanel to something better supported, but there hasn't been any visible progress by cPanel yet. This is going on like two years now lol. They must not be trying very hard.
|
|
# ? Nov 14, 2012 03:38 |
|
Knyteguy posted:
You really should check out Heroku is all you want to do is mess around with Rails
|
# ? Nov 14, 2012 04:54 |
|
Speaking of, can I get any of you who use heroku to beta test something I've been working on releasing soon? I'd really appreciate the feedback: https://dataclips.heroku.com
|
# ? Nov 14, 2012 08:33 |
Pardot posted:Speaking of, can I get any of you who use heroku to beta test something I've been working on releasing soon? I'd really appreciate the feedback: https://dataclips.heroku.com Wow I need to brush up on my pg syntax. Been mired in mysql for too long. Anyways this is a neat idea. Have you considered unifying the views from postgres.heroku.com/databases/:db_name/dataclips and dataclips.heroku.com? A MIRACLE fucked around with this message at 16:23 on Nov 14, 2012 |
|
# ? Nov 14, 2012 16:16 |
|
A MIRACLE posted:Wow I need to brush up on my pg syntax. Been mired in mysql for too long. Yeah, the ones on postgres.heroku will be migrated over to the new thing once it's released.
|
# ? Nov 14, 2012 16:28 |
Also a small front-end nitpick,CSS code:
CSS code:
|
|
# ? Nov 14, 2012 16:48 |
|
request.env['HTTP_USER_AGENT'] =~ "Chrome" returns 69 in a chrome browser. Best I can tell, it's the index of the first occurance? Regexp are confusing as gently caress to me. Nevermind, I had to read better! Physical fucked around with this message at 17:35 on Nov 14, 2012 |
# ? Nov 14, 2012 17:32 |
|
Has anyone here tried to pull data from the google analytics API from within a rails app? It seems like an utter clusterfuck with a bunch of defunct gems to interface with it, and Google's own ruby library in alpha. I can't find half decent sample code anywhere on the web
|
# ? Nov 15, 2012 00:35 |
|
MrDoDo posted:You really should check out Heroku is all you want to do is mess around with Rails I saw Heroku but thought it was only pay-to-use. It's not a big deal though, I got to brush up on a bit on my server administration skills. The biggest problem I can see with Heroku though, is if you really ever want to go live with an app it could end up costing a lot due to having to pay to upgrade the plugins to premium eventually. It's like an impulsive developer's nightmare.
|
# ? Nov 16, 2012 01:33 |
|
What would keep you from just migrating to something else if you didn't like the price?
|
# ? Nov 16, 2012 01:57 |
|
Knyteguy posted:I saw Heroku but thought it was only pay-to-use. It's not a big deal though, I got to brush up on a bit on my server administration skills. I think the question is what's the value of your time early on in a project. Do you want to spend time computer janitoring a server, or do you want to spend that time writing code that could make you money and deal with migration if it takes off?
|
# ? Nov 16, 2012 02:57 |
|
kitten smoothie posted:I think the question is what's the value of your time early on in a project. Do you want to spend time computer janitoring a server, or do you want to spend that time writing code that could make you money and deal with migration if it takes off? In my personal(work and cloud stuff is a whole different can of worms) situation with just a Windows machine, you need a Unix or Mac environment to develop with Ruby effectively. Setting up a VM or real machine is going to be necessary anyway. Going one more step of setting up apache+passenger or nginx isn't a huge leap from there. Heroku looks really awesome but until I actually need to deploy something to the Internet for real, it seems to me it would take more time to learn and manage that than just to go with what I know.
|
# ? Nov 16, 2012 03:16 |
|
|
# ? May 30, 2024 04:02 |
|
kitten smoothie posted:Do you want to spend time computer janitoring a server, or do you want to spend that time writing code that could make you money and deal with migration if it takes off? Seriously, this.
|
# ? Nov 16, 2012 04:05 |