Category Archives: Ruby

Rails Association

Spent a day learning how about associations.  Realized that has_and belongs to and the necessary join table isn’t as easy to use as creating a regular join model table and use has_many :through. Join Table = create_join_table Join Model Table = … Continue reading

Posted in RoR | Tagged , , | Leave a comment

Rails here we go

Finally moving forward to redoing a website that is all DB driven to a Rails platform.  Designing DB schema and models. woot.  Wish I could bring in a Rails consultant though

Posted in RoR | Tagged | Leave a comment

RoR 4.0.2 issues

gem “mongoid”, github: “mongoid/mongoid” kept giving me the error: fatal: read error: Connection reset by peer Git error: command `git clone ‘git://github.com/mongoid/mongoid.git’ “/home/mfang/.rvm/gems/ruby-2.1.0/cache/bundler/git/mongoid-176c799a8a4589043b073e277e545d697119fa82” –bare –no-hardlinks` in directory /home/mfang/dev/ror/aws-iar_mygitstation has failed. Changed it to gem “mongoid”,  :git => ‘https://github.com/mongoid/mongoid.git’ Now it … Continue reading

Posted in RoR | Tagged , , , | Leave a comment

Ruby on Rails Tutorial – Chapter 5

This chapter is more about front end web page changing portion and using TDD to do coding.  I like how it’s always adding a test case first, make sure it fails, then add code to make it work. Really drives … Continue reading

Posted in Coding, RoR | Leave a comment

Ruby on Rails Tutorial – Chapter 4

This chapter is mostly about Ruby syntax. Skip or skim Part 4.1 is OK since there’s an example of using a function to populate the <title>.      

Posted in Coding, RoR | Tagged | Leave a comment

Ruby on Rails Tutorial – Chapter 3

Best to look within the GitHub project to write the correct Gemfile. If you see the error that visit is undefined, in the Gemfile add group :test do gem ‘capybara’, ‘1.1.2’ end Then do bundle install –without production Pretty pointless … Continue reading

Posted in Coding, RoR | Tagged | Leave a comment

Ruby on Rails Tutorial: Chapter 2

Pretty simple chapter. Got through it within an hour.  After working on CakePHP there is quite a bit of similarities between the two MVC frameworks.  Glad I got some work in on CakePHP to prepare me for this. OK spoke … Continue reading

Posted in Book, Coding, RoR | Tagged | Leave a comment

Ruby on Rails Tutorial: first_app deployment

Man took to 3 days to setup RoR and get the first_app successfully deployed. Advice if you’re using windows, use some virtualization and use Linux.  Actually follow the Gemfile instructions as is. Even better would be to use the Gemfile … Continue reading

Posted in Coding, RoR | Tagged , | Leave a comment

Ruby on Rails Tutorial

Goal from now until the end of August is to finish the Ruby on Rails Tutorial book. I’m reading the book through Safari but just found the link to it online this online book is better updated than the published book. … Continue reading

Posted in Coding, RoR | Tagged , | Leave a comment

Ruby: Neat function uniq.size

My first Ruby program ever was to write a function to determine if a triangle given the size of its size, was scalene, isosceles or equilateral. I wrote if statements to see if the sides were equals, but ruby can … Continue reading

Posted in Ruby | Tagged | Leave a comment