Archive for the ‘ruby on rails’ tag
RoR Newb Note: Gems are installed per RubyGems version
So while working on ShoutReel, I had to upgrade to a newer version of RubyGems in order to use the i18n version of the geokit gem. When I upgraded, it said I was missing all the gems for the app. Consulting with my friend who told me that when upgrading RubyGems, you also have to re-install all the gems for the app.
This is just a newb note for myself as well as anyone on the Internet having this issue.
Diving into Ubuntu (again)
A while ago, I attempted to start using Ubuntu, but failed to install it on an old gateway laptop that didn’t have any linux drivers for audio, visual and wifi devices. Or at least I couldn’t find any online for the laptop. Due to the failure in getting it to work, I stopped my Ubuntu journey. I wasn’t ready for it. Skip forward a year later and I found myself installing Ubuntu 10.04 on my newer HP laptop. Installation was a breeze and everything worked out of the box except for some issues with double fingers on the touchpad and the right/left click ares on it. I was impressed. Wifi, bluetooth, sound, video, and pretty much everything worked instantly with Ubuntu.
As soon as I started to use it for a few hours, I noticed they took a some of their UI from Apple’s OS X and Windows. It’s the best from both OSs combined into one. Workspaces is cool. I’ve never experienced that working on Windows. I find that very useful when multitasking. I also like the way alt-tab works when switching from one item to another.
The best part of it all is developing with Ubuntu, which is the main reason I switched. I was having a hard time dealing with Windows and developing with Ruby on Rails. On Ubuntu it was extremely fast for obvious reasons. I haven’t tried developing in PHP or Java yet, but will soon.
Check out Shoutreel!
We’ve made some updates to Shoutreel. Check it out and tell me what you think.
Creating Static Pages in Ruby on Rails
Want to create a static page with this type of url like yoursite.com/about for a Rails app? Well I had to just that for an app I am currently building.
Basically it involves a controller and added a route to routes.rb. The first step is to create a simple controller:
class StaticController < ApplicationController
def about
end
end
I called my controller static, but you can call it whatever you want. In the views/static directory I created a simple about.html.erb file with the html:
About
content here
Then in the routes.rb I added the route:
map.static 'about', :controller => 'static', :action => 'about'
And that's basically it. This is a really basic way of creating static pages in Rails. There are definitely more advanced and probably much better ways of dong this. Since I'm just a beginner this is what I did for now.