I always like to throw my app to heroku to test but battled with this error for a little while until I realised… I needed to run $ heroku run rake db:migrate I’m all good now:)
Took me a little while to get my head around testing but thanks to the rails tutorial it’s starting to sink in. Here’s how to make testing g a lot easier thanks to guard and mini-test reporters. For the full guide head over to here, this is just so I remember it!
After moving the contents of <head>…</head> to a partial you can add a title dynamically to each page. To get the title to render you need to add <title><%= full_title(yield(:title)) %></title>
Created a new project, installed Guard and using mini-test helper but getting a ‘There is a version mismatch between the spring client and the server.’ in Guard. Fix: Stop the server (ctrl + c) and exit guard $spring stop $bundle update Restart server & guard Done
Just in case anyone else is receiving an ‘Application Error: An Error occurred in the application and your page could not be served’ error after pushing your rails project my fix was pretty simple. In the console I ran: $ heroku run rake db:migrate This gave me an error saying that because Heroku didn’t support SQLite3… Read More »
Thanks to Apple’s annual OS X update I swiftly jumped on the El Capitan bandwagon, little did I know it would mess up a few things for my Rails Dev. First off Bundler vanished and I was receiving a ‘-bash: bundle: command not found’ error. I had to go back and install bundler again using… Read More »
Sometimes you just need to repeat the same code across the site and whilst it’s great to have it in the application.html.erb file it can make it look a little messy… that’s where partials come in. A partial is basically a part of your code you want to reuse and here’s how to do it.… Read More »
To create a link to another page in rails you use the ‘link_to’ method and pass in the internal path of the page. I have a view called about.html.er in my static_pages folder in views, so to link to this from another view I would use: <%= link_to (“Text you want to appear”, folder-name_view-name_path) %>… Read More »