Hmm I'm still using RVM, guess I'm a noob. But if anything can simplify the Postgres install, sign me up. Although I heard Heroku was building a better management tool which would be super handy.
|
|
# ¿ Mar 29, 2012 03:41 |
|
|
# ¿ May 14, 2024 01:05 |
Pardot posted:I will help you set up postgres, post any problems you have. I personally just use homebrew for what it's worth. Oh, I have no problem setting it up now that I've done it a thousand times . But it's a consistent roadblock when I'm trying to ramp up new users to Rails development, as they usually can't figure it out themselves. Thanks for the helpful offer though. And I'll definitely check out Induction.
|
|
# ¿ Mar 29, 2012 05:20 |
You realize there's a giant PaaS that uses Postgres exclusively, right? Not to jump down your throat but are you even reading the thread?
|
|
# ¿ Mar 30, 2012 15:48 |
I use Heroku exclusively for my projects because finding good ops people is hard and gently caress if I'm ever touching a server. I break IIS enough to know I'm not the guy for that . Also I must be the only person in Knoxville who knows what a Rails is.
|
|
# ¿ Mar 30, 2012 16:13 |
Well, you'll just get better at Ruby by writing lots of Ruby code. You'll probably have to go back and refactor your first app a poo poo-ton. Just stop writing so much code in the views! This isn't PHP for god's sake.
|
|
# ¿ Apr 3, 2012 19:02 |
I'm gearing up for some upcoming Rails job interviews, anyone have study tips?
|
|
# ¿ Apr 4, 2012 10:52 |
Be sure to check out Railstutorial.org as it has a ton of great resources.
|
|
# ¿ Apr 24, 2012 10:11 |
Tomed2000 posted:I'm not sure where to begin with this one but I have a Rails app on Heroku right now that uses Devise for handling user authentication and I've got about 50 customers with accounts. I recently wrote a C# application and I'd like to implement some sort of authentication before users can start running this app. Is there any way I can make the Rails app communicate with the C# app? I know this is possible with Microsoft SQL Server and IIS but I'd really just love to send a request to the postgres database on Heroku for validation or use some other technique that allows me to query the Rails app for user login info. Well, you can take advantage of Rails' RESTful api design. Submit a POST to the corresponding sessions controller (that handles logins) and specify in the headers that you want a json formatted response of some kind. XML would work too I suppose. Then parse the results when they come back from the server in your C# code. It's really late and I've been coding all day so I might have missed something but that seems like the most straightforward way to do it.
|
|
# ¿ Jul 6, 2012 04:44 |
Jam2 posted:What an acceptable amount of time for it to take to render a view in response to a request? Is 70ms too long in a development environment? As I haven't pushed anything to production, I cannot tell how careful I should be about performance and optimization in the initial development stage. (writing my first major application) Don't get into premature optimization. Once you deploy on production mode it'll be much faster anyway (because Rails won't have to knock down and reload your classes with every request).
|
|
# ¿ Jul 6, 2012 13:39 |
Jam2 posted:What's the best way to make this readable and within 80 chars per line? code:
|
|
# ¿ Jul 17, 2012 14:05 |
prom candy posted:Note that in 1.8 you would have to put the dots at the end of the lines rather than the beginning. Pretty sure it's valid.
|
|
# ¿ Jul 17, 2012 14:46 |
Jam2 posted:
returns self unless user evaluates falsy, otherwise returns all records of self's class that have a secured value of false in the database
|
|
# ¿ Aug 3, 2012 19:42 |
prom candy posted:It's checking it against nil, it's basically a really quick way to check if someone is logged in. Just a thought, couldn't you skip this step by integrating CanCan or the like?
|
|
# ¿ Aug 3, 2012 22:19 |
How do you guys usually deal with gem dependency conflicts? Specifically,code:
|
|
# ¿ Aug 24, 2012 16:03 |
Yeah, that's sorta what I thought... thanks.
|
|
# ¿ Aug 24, 2012 19:33 |
epalm posted:Hi folks! I'm updating Redmine from 1.3.1 to 2.0.3, which involves updating rails 2 to rails 3, among other things. They both sound like a PITA, but I'd probably just follow the guide. Are you using Pik? It might not apply in this situation but I found it helpful when I developed on Windows. (https://github.com/vertiginous/pik)
|
|
# ¿ Sep 7, 2012 16:48 |
So, what's the best approach to enhancing gem-based ActiveRecord extension classes? Specifically I want to add a few class methods to the audited gem. Suppose I have a "Searchable" module with some helpful class methods that I've successfully integrated into some other ActiveRecord models using ActiveSupport::Concern. It looks kind of like this: Ruby code:
Ruby code:
|
|
# ¿ Oct 9, 2012 20:30 |
That's not so bad. I'm on a team that writes migrations that look likeRuby code:
|
|
# ¿ Oct 16, 2012 21:16 |
It's what happens when you decide to outsource development to a team of Eastern Europeans who don't speak English (our image gallery is spelled "Galery.rb") or care about things like unit test coverage, standards or best practices, and think it's okay to write 500 character SQL queries on a single LOC. This is for a fairly prominent "daily deals" type site by the way, and the codebase is responsible for processing upwards of 200k in sales / day. I was brought on last month because the higher-ups were all "oh poo poo we don't have any developers stateside." I'm basically the SQL monkey / put out fires ops guy right now but I'm pushing for a refactor / unit test project before any new features are added. We'll see. At least the pay is good for my area.
|
|
# ¿ Oct 17, 2012 15:34 |
prom candy posted:Have you tried https://github.com/thedarkone/rails-dev-boost If he's on Rails 2 he doesn't have the asset pipeline, which only came about after Rails 3.1. That plugin looks interesting. It reminds me of how Scribd handled development mode (they have a huge Rails 2 app). They basically ran a watch script (think SASS compiler) that monitored and reloaded classes only when they were modified, instead of dumping the whole app and reloading every class per request. It's an interesting problem.
|
|
# ¿ Oct 19, 2012 15:09 |
Shame Boner posted:I think I did a bad thing. This morning, mysteriously my rails server wouldn't start. It was bombing out with the message /Users/ShameBoner/.rvm/gems/ruby-1.9.3-p286@rails_3_2/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- trace_nums (LoadError). I suspect that I properly hosed my gemset by doing a bundle update while rubygems.org's dependency API is down. I'm not sure what gem is responsible for the TraceNums class, but it seems to be missing. Is there any way to un-gently caress this gemset? For the time being, I had to go back to using my 1.9.2 version of Ruby. That's always fun. I hope this isn't for a big project because it could get a little hairy. If your Gemfile.lock is in version control you can look at a previous version where everything was working, then manually go through your gemfile, setting specific versions of all your gems. From there just update as necessary.
|
|
# ¿ Oct 19, 2012 17:06 |
Wow, that seems kind of awkward, I didn't know people still inlined ruby in their javascript code. I hate to recommend js frameworks since it seems like you're already really far along with this method, but I've been really happy using either Angular, Backbone, or Knockout.js (with underscore.js as a utility belt) for my ajax-y goodness.
|
|
# ¿ Oct 22, 2012 15:51 |
mmachine posted:Ha! Well it definitely felt awkward. Well the way I use them is, I basically treat Rails like an API / REST layer with routing and business logic, and then the js on the front just talks to Rails. I think (Backbone || Angular) + underscore would be a good starting point if you're actually interested in using a js framework. I've used Knockout extensively but that was with .NET, not sure how well it gels with Rails.
|
|
# ¿ Oct 22, 2012 16:17 |
Shame Boner posted:I'd also give Spine.js a look as an alternative to Backbone. Spine is written in Coffeescript, has no dependencies, and is teeny tiny. After learning Coffeescript, I found that it made me love Javascript more, but also never want to write Javascript again, if you know what I mean. There are some ugly parts of the syntax (mixed array/hash objects, I'm looking at you), but I find it much more readable, concise, and faster to write. Unlike Backbone, Spine doesn't really have a concept of a view, so you must plug your own templating solution into it. I use HAML/Coffeescript through the awesome haml_coffee_assets gem. I'll have to check Spine out, but the main reason I shy away from Backbone is the inevitable function-pointer-callback soup I get mired in for trying to manually render elements asynchronously. The MVVM pattern in Angular seems to solve this problem nicely. Also, I'm not entirely convinced Coffeescript is better than plain JS. Prettier? Definitely. I'm probably going to wait out the whole "compiles to javascript" language battle that seems to be happening right now and go with the community consensus.
|
|
# ¿ Oct 24, 2012 19:15 |
Active Admin + your favorite SVG based javascript graphics library.
|
|
# ¿ Oct 30, 2012 07:42 |
If all you care about is running your own SQL commands, look into using the Sequel gem instead of ActiveRecord. But I recommended ActiveAdmin because I think it has a pretty interface :3
|
|
# ¿ Oct 30, 2012 15:44 |
Depending on what you're trying to do you could look into extending existing ActiveModel classes with ActiveSupport::Concern (which usually go in app/concerns), or just creating your own folder app/myclasses/my_class.rb, and including it in whatever file you're using the class in. Alternately, load it in your environment config by adding the path there to make it available to all classes.
|
|
# ¿ Oct 30, 2012 20:47 |
Pardot posted:Give sequel a looksee http://sequel.rubyforge.org/ Speaking of Sequel, I've been using it a lot for production DB scripting here at the office, and was wondering if there's a faster way to do this: Ruby code:
|
|
# ¿ Oct 30, 2012 21:44 |
Physical posted:I created a folder in my app directory called classes with a file classes/input_field.rb defined as What does your controller look like? Are you using relative pathing or including the path in your root environment?
|
|
# ¿ Oct 30, 2012 21:53 |
Physical posted:
Nope! Check this out: config/application.rb posted:
e: looks like syntax highlighting is "broken" for string interpolation inside of a %w. What does SA use for syntax highlighting? Pygments? A MIRACLE fucked around with this message at 22:08 on Oct 30, 2012 |
|
# ¿ Oct 30, 2012 22:05 |
Physical posted:Thanks found that shortly before you replied. Now my issue is variables. Yeah... you haven't defined name as an instance/class variable for InputFields. There's a shortcut, attr_accessor :my_variable, which is like a getter/setter in C# for example. edit: Shortcut for doing this: Ruby code:
A MIRACLE fucked around with this message at 22:22 on Oct 30, 2012 |
|
# ¿ Oct 30, 2012 22:18 |
Physical posted:Holy poo poo I did namee and name. Forgot that I wanted to use namee in the controller. Even if I did spell it right I still have to use the attr_accessor. If it's included in the Rails environment you don't have to for classes I think. But yeah, to include something means that something is a module, and you want to use it as a mixin, ie have that module now be a part of your class, with all its methods and variables and what-not. Just require '../myfile' or whatever in the future, or have it in the environment already.
|
|
# ¿ Oct 30, 2012 22:27 |
Use the def initialize constructor. Ruby code:
|
|
# ¿ Oct 31, 2012 16:19 |
`@name` becomes an instance variable, `name` will just be local to the `initialize` method, and will be garbage-collected when the method is finished executing.
|
|
# ¿ Oct 31, 2012 16:32 |
Don't put it in a migration. That poo poo is a nightmare to maintain, esp when you bring new devs on.
|
|
# ¿ Nov 1, 2012 15:52 |
I'm going to try damned hard to make RailsConf in Portland next April.
|
|
# ¿ Nov 2, 2012 16:33 |
IDK man I would honestly look into Node.js and websockets and stuff if you want to make a chat room. You could probably still hook it up to ActiveRecord if you want a sql log of the messages.
|
|
# ¿ Nov 5, 2012 22:10 |
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 |
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 |
|
|
# ¿ May 14, 2024 01:05 |
Does CPanel even support Rails 3?
|
|
# ¿ Nov 14, 2012 00:27 |