Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Andy L's Profile

This user is a moderator.

GitHub User: andyl

Comments by Andy L

Avatar

+1 for Teaspoon - just a great tool for testing JavaScript - kudos to @Jeremy.

Avatar

This worked for me...

CoffeeScript
@testApp.config ["$httpProvider", ($httpProvider) ->
  token = $('meta[name=csrf-token]').attr('content')
  $httpProvider.defaults.headers.common['X-CSRF-Token'] = token
]
Avatar

On Rails4, this didn't work for me in config/environment/production.rb:

config.assets.js_compressor = Sprockets::LazyCompressor.new { Uglifier.new(mangle: false)}

but this did work:

config.assets.js_compressor = Uglifier.new(mangle: false)
Avatar

Another option is X-editable. It offers similar functionality, but uses Bootstrap/JqueryUI/Jquery elements. Really works fantastic in my Bootstrap UI.

Avatar

If you want a multi-domain solution, I think you'd do that configuration in your front-end web-server/proxy, configuring nginx/apache to handle multiple vhosts.

Avatar

Can anyone describe how FnordMetric compares/contrasts to graphite-statsd??

Avatar

Is unicorn compatible with jruby ??

Avatar

+1 for coverage of the Rails OOP movement & how to achieve fast tests

Avatar

Wow - supervisors. There's Erlang in my Ruby! I'd like to learn more about Celluloid.

Avatar

+1 - this would be very useful

Avatar

Every time I've tried Devise, I've run into some sort of use-case that it doesn't handle. My typical workflow was to waste lots of time trying to configure Devise to fit my app, then rip it out.

Now I do authentication from scratch every time.

For me, lower-level abstractions like 'has_secure_password' work perfectly. Devise not so much.

Avatar

Thanks for the valkyrie tip - I've started using it - super fast and simple.

Avatar

Does anyone know a good technique for auto-generating API documentation?

Avatar

Taps looks interesting, but complicated. The yaml_db gem looks like a simple way to backup and restore data. Does anyone have any experience using yaml_db to migrate from sqlite to PG?

Avatar

Vagrant-Snap is an add-on for taking disk snapshots. Very fast and simple to use - much faster than rebuilding machines from scratch.

https://github.com/t9md/vagrant-snap

Avatar

Chris you could set up Vagrant / Virtual box, which would give you the flexibility to test different OS versions.

Avatar

Well I'll answer my own question. :-) I dug into Puppet last week - the tools it has for creating users, installing packages configuring systems etc would take a lot of time to rebuild from scratch in Capistrano. So I've become a Puppet user & believe its worth the time to learn. But this is a complicated tool, and it still seems like there is a need for a simpler deploy tool than Chef or Puppet.

Avatar

Sometimes Chef just seems so heavy. Using Capistrano for provisioning would means one less tool to learn...

What problems does Chef solve that can't be addressed by Ryan's Capistrano approach? I know chef is good for large deployments, but for small/medium sized systems this Capistrano approach seems great.

Avatar

Is Refinery compatible with Twitter Bootstrap?

Avatar

Also - can anyone explain how hook_for is supposed to work?

Avatar

Does anyone have any tips for testing generators?? It looks to me like test/unit has some helper methods for testing generators, but I haven't been able to find any references or tutorials.

Avatar

+1 for Backbone/Rails/Twitter bootstrap - very cool

re: Coffeescript/Backbone/Datatables - you might want to check out Slickback - a plugin that integrates Backbone and Slickgrid.

Avatar

What a great episode - thank you !!

I'd like to see more episodes on Backbone - like:
- handling associations between models in a Backbone app
- caching data using localStorage
- using multiple view objects and multiple routers
- appCache and Backbone
- testing with Jasmine and Sinon

Avatar

Backbone is more mature - there are lots of online videos, blog posts, and example apps for BB - not so much for Ember. Right now Ember also lacks support for routing and persistence.

Avatar

Derick Bailey also has a great list of resources with lots of books, blogs and videos.

Avatar

Backbone and Rails is an awesome combination! Glad to see Backbone here on RailsCasts.

Another gem worth reviewing is backbone-rails. (https://github.com/codebrew/backbone-rails)

The scaffold generator of backbone-rails creates ready-to-run routers/models/collections/views/templates.

Avatar

Is jBuilder similar to RABL? (I think it is...) If so - what are the pros/cons of jBuilder vs RABL?

Avatar

I for one would be interested in learning how to handle inbound faxes. :-)

Avatar

Austin - look at this page

https://github.com/jcasimir/draper  

See "Integration with Rspec"...

Avatar

Does Passenger support http streaming in Rails3.1 ??

Avatar

I'm curious: why the preference for h.content_tag, instead of a little snippet of HTML ?? Is there a reason, aside from aesthetics?

Avatar

Draper describes itself as a Decorator. Can anyone explain the difference between a Presenter object and a Decorator object??

Avatar

Looks like MetaWhere isn't compatible with Rails3.1. Is there another gem like MetaWhere that works with 3.1? There is Squeel, but it uses a funky syntax, and I'd rather stick with something with a syntax that somewhat resembles standard Ruby & Arel.

Avatar

For testing I use rspec, spork, guard, guard-spork, capybara, capybara-webkit, database-cleaner, factory-girl, vcr, aruba, rcov, jasmine, and jasmine-rails. And there are lots of other tools that I could be using (cucumber, mocha, etc. etc.)

To me it feels like the world of Rails testing is out of control. This kind of complexity is why I left Java!!

Avatar

Also have a look at VCR - a great testing tool for recording and playing back http interactions.

Avatar

Here's another way to work with Google Maps: jquery-ui-map - a jQuery plugin.

http://code.google.com/p/jquery-ui-map/

Avatar

To get the ball rolling - here are some example gists that show how to do 'remember me' and 'redirect to target page'.

'remember me' sets a cookie. if the person kills the browser, then opens a new session and returns to the page, the user will be auto logged in. cookie times out in 100 hours.

'redirect to target page' sets the referring URL in the protected controller (using authenticate_member!). then after the person logs in, they are redirected to the page they wanted.

Login Form: https://gist.github.com/1032488
Sessions Controller: https://gist.github.com/1032490
Application Controller: https://gist.github.com/1032492

Avatar

Using this screencast, I was able to get rid of Devise in about 20 minutes. THANKS!!

I think a lot of people would benefit from a screencast that shows 'advanced' authentication options like: remember me, forgot password, session timeouts, email registrations confirmations, ...

Avatar

Is there an automated way to convert from javascript to coffeescript??

Avatar

Does anyone know of a way to 'hyperlink' from an rspec failure message to the correct file & line number in vim ??