RailsCasts Pro episodes are now free!

Learn more or hide this

murdoch's Profile

GitHub User: murdoch

Site: http://www.alivefrommaryhill.net

Comments by murdoch

Avatar

Can you tell us what an alternative would be?

Avatar

Yeah, you should find the following at the bottom of your spec/spec_helper.rb file:

ruby
# Run specs in random order to surface order dependencies.
config.order = "random"

This has been part of rspec for several months now, you probs just didn't notice it.

Avatar

thanks for that link, some excellent tips from that guy

Avatar

Lets say I had an app on heroku, with omniauth configured to let users sign in with twitter. Would I need an SSL certificate on my site, or is it safe without one?

Avatar

If you are on linux or mac, then you can put it a file called /home/.bashrc

  • cd $HOME
  • vi .bashrc
  • then add your variable near the bottom like so:
ruby
export NAME_OF_VARIABLE=xyz123

Tip: Use your real variable name, there's usually no need for quotation marks, and the export keyword is required as shown above. Finally, you should make sure your variable name is written in UPPER_CASE.

Remember to save and close the file, before reloading your command prompt.

Avatar

Quick question, I notice that the facebook sign-in popup uses SSL, but the app you create does not. Would you recommend adding SSL everywhere, in order to stop session attacks? Heroku charge a whopping $20 per month to enable SSL endpoints.

Avatar

ditto, and there have been some damn good episodes over the years

Avatar

This github issue might help you fix the problem, it looks like you want to substitute all references to activerecord with activemodel. Make sure you do it in your locale file too.

Avatar

Chapter 8 of railstutorial shows you how to do that: http://ruby.railstutorial.org/chapters/sign-in-sign-out#top

Pay particular attention to section: 8.2.1 titled "Remember me"

Avatar

what Operating System are you using?

Avatar

"bundler will only fetch the metadata for the gems that it needs, and not every gem known to man"

made me laugh :)

Avatar

creating contact pages used to be a bit of a pain, but this makes life much easier

Avatar

been using this for a while myself, along with flutie, also by thoughtbot

Avatar

thanks ryan, fwiw, here's decent tutorial on how to get bootstrap-sass, formtastic and tabulous working together: http://rubysource.com/too-good-to-be-true-twitter-bootstrap-meets-formtastic-and-tabulous/

Avatar

Thanks so much for this one. There's also a decent tutorial on heroku's website that shows you how to build a static site using rack - link here http://devcenter.heroku.com/articles/static-sites-on-heroku

Avatar

thankyou, I've actually been using this gem since the early days of development but did not know about History module until today. It's a neat feature.

Avatar

I have a question regarding the history module.

Let's say that I create a post titled "Hello" and get the url site.com/post/hello but I decide to update the title to "Hello World" and I now have an updated URL site.com/post/hello-world.

I use the history module to redirect from the old url to the updated one.

What happens if I try to create a new post with the old title? (Imagine that I have validates :title, :uniqueness=> true)

Will ActiveRecord take friendly_id's historic slugs into consideration when validating future user inputs?

Avatar

yes, and it's also definitely worth checking out Ruby Monk as well as The Ruby Game

Avatar

Totally blown away by this. It makes AJAX so much easier, the way it should be, thank you

Avatar

My features are running twice too. Is that normal? I understand that two spork environments are requires, but surely my features should only run once?

Avatar

I find myself getting the following error unless I include guard in my Gemfile too:

No such file or directory - Guardfile (Errno::ENOENT)

FWIW, using rails 3.1.1 and guard-rspec 0.5.0

Just saying incase anyone else runs into this problem too

Avatar

really like the coffee script stuff in this, I learned a lot

Avatar

that's pretty much the way a lot of people are doing things now - although I dunno if authentication is something for which I'd use an engine - maybe you would though

if you can afford it, I'd recommend buying and reading "Crafting Rails Applications" by Jose Valim, from where much of rails3.1's updated engine code was extracted (see the enginex gem if you're on older rails)

ryan bigg posted a link to this nice forum engine he made http://github.com/radar/forem

and here's my favourite engine atm (called rails admin) which handles all your back-end stuff (== no more django-envy): https://github.com/sferik/rails_admin

Avatar

you read my mind with this railscast - was looking for something like this