Articles tagged with 'rails'
I was doing some optimizing the other day on a Rails 2.3.x application with a metal controller. I didn’t feel like writing a straight rack application, so I used sinatra. A pretty good explanation of how this works can be seen in Adam Wiggins’ slides, Rails Metal, Rack, and Sinatra
In Rails 3, they still have metal controllers, in that the ActionController::Metal class is essentially a really thin controller, and you can use it lik...
If you’re in the ruby world, and specifically the web side of the ruby world (Rails, Sinatra, etc), you should probably know who Zed Shaw is. I mean, he only wrote mongrel, which you’re probably using as your application server.
Well, he’s been hard at work on Mongrel2, and it’s a big change from the original mongrel.
Mongrel2 isn’t a ruby web server. It’s (and I’m going to borrow straight from the sit...
It’s 10 minutes past 6 on Sunday evening, and we just wrapped up our Rails Rumble 2010 project.
Check it out at http://gemrage.com/. Check out our team here too.
This. Shit. Was. Real.
We had a rough start with lack of internet for 3 hours, had a few depressing times thinking we’d never finish, but we rocked our socks off with Windows and Internet Explorer, MacBooks, Twitter and Campfire, and produced a pretty cool application.
Ple...
It’s been a while, but we’re continuing the Top 25 Most Dangerous Software Errors with numbers 10-6.
10. Missing Encryption of Sensitive Data
Have you ever signed up for some website or service, only to receive an email 30 seconds later WITH YOUR PASSWORD IN IT! Doesn’t it just fucking kill you?
Have you ever used a ‘Forgot your password’ page only to be blindly given your password? Fantastic. I highly doubt they ...
Rails developers aren’t exactly known for getting their indexes right (or even at all) on their databases. Granted, databases are a tough subject, and some people and companies make their living dealing with only databases, and some only with one database (like MySQL or Oracle).
If you’re coming to web development with no formal background in databases, and it’s all new to you, then it’s totally understandable to maybe ...
A quick post for today.
Want to get rid of transactions from ActiveRecord for something? Here’s a cheap way to do it.
It only works for MySQL obviously, but you can roll your own if you are on postgres. I’ll make it a bit less crappy and make it a gem or something.
Lots of interesting things are afoot, and I try to keep track of them. Here’s what I’m watching.
Rails 3
Lots of new changes are coming with Rails 3, and it’s pretty exciting. I wrote about some of the cool ones here. Rails is shaping up to be faster, more modular, and generally better and easier to work with. With all the smart people working on it, you don’t have to look very hard to realize this is going to be a big ...
The Rails 3 Beta got dropped a few days ago, and the release notes for Rails were put out a bit before that.
The list of changes is long; this is a big release. There’s a lot to sift through, a lot to change to upgrade your existing application, and a lot to learn whether you are upgrading or starting a new app.
The big question is: WTF does all this mean to me?
Don’t worry, I’m going to tell you. If you want to read the full...
Yehuda Katz’s slides from SD.rb on Rails 3. I can’t wait!
Vaporware To Awesome
So check this: you have a nice little Rails app. You have some stuff for a JSON API type system. You’ve got an STI setup with the Widget model class and the more concrete FancyWidget and WeirdWidget classes. You’ve got a WidgetsController, and the corresponding FancyWidgetsController and WeirdWidgetsController
Yay. It works. You can deal with both types of Widgets using JSON.
Now you need an HTML interface to it.
Fine, you can just...
I looked at a few role systems for Rails, but never found what I wanted. They were all object based systems, never just “allow a user with this role to do this action”. Either that or I never found the systems that did that, or totally missed the docs on how to configure those systems to do what I wanted. Well, actually acl9 seemed to do that, but whatever.
So I made role_on
The instructions are on Github, so I won’t repeat t...
Ruby on Rails content_for
Project: Builder
RSS
pauldix-feedzirra
Basic Rails association cardinality
Nested Object Form with has_one Relation
I like frameworks, but sometimes debugging them is more entertaining. I don’t know why I didn’t think of this method before, but mischa on github has a great little repo showing how you can do it.
The README
Usage:
Add:
require ‘ruby-debug’
require ‘cucumber_rails_debug/steps’
To features/support/env.rb
Then use:
Then debug # opens the debugger
or
Then what #prints out params, url and html
Check it ...
Selenium is a suite of tools to automate web app testing across many platforms. Cucumber is a BDD framework that allows you to write things in English (or whatever language you want, really), and have that execute as code. Put those together with webrat and rspec and you have a pretty mean stack to test your ruby on rails web application with. Sort of.
I’ve been having some problems with it, getting it set up, but it’s coming along...
The ruby-openid gem was giving me problems with Passenger, causing IOError problems.
I found the fix here
The gist of it?
Add
OpenID::Util.logger = RAILS_DEFAULT_LOGGER
To environment.rb, and you’re good!