{"id":24370770,"url":"https://github.com/rama41222/ruby-footprints","last_synced_at":"2026-05-18T09:34:42.946Z","repository":{"id":42605195,"uuid":"204062923","full_name":"rama41222/ruby-footprints","owner":"rama41222","description":"This are the steps I'm following to learn ruby on rails framework","archived":false,"fork":false,"pushed_at":"2022-12-14T07:37:10.000Z","size":73,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-24T15:47:12.454Z","etag":null,"topics":["12-factor","dry","jruby","learning-by-doing","rails","rails-framework","rubinius-compiler","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rama41222.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-23T20:05:01.000Z","updated_at":"2019-09-08T09:43:37.000Z","dependencies_parsed_at":"2022-08-27T11:22:05.855Z","dependency_job_id":null,"html_url":"https://github.com/rama41222/ruby-footprints","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rama41222/ruby-footprints","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rama41222%2Fruby-footprints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rama41222%2Fruby-footprints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rama41222%2Fruby-footprints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rama41222%2Fruby-footprints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rama41222","download_url":"https://codeload.github.com/rama41222/ruby-footprints/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rama41222%2Fruby-footprints/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33172653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["12-factor","dry","jruby","learning-by-doing","rails","rails-framework","rubinius-compiler","ruby","ruby-on-rails"],"created_at":"2025-01-19T04:48:13.058Z","updated_at":"2026-05-18T09:34:42.928Z","avatar_url":"https://github.com/rama41222.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Intro\n\nThis is my attempt to learn ruby on rails. I will be making sample apps by following tutorials. \n\n\n## Section 1\n\n### General commands\n```\nrvm list # List down the ruby versions\nrvm use [version ] # Switch the ruby version\nrails -v # Current rails version\n```\n\n### Generate rails project\n```\nrails _5.3.4_ new [project_name] # Generate new project \n```\n\n### Run rails project\n```\nrails s -p [port] # Run rails by specifying a port\nrais s --binding=0.0.0.0 -p [port] # Start with with host name and port\n```\n\n### Rails console\n```\nrails c # Open the console\n```\n\n### Run a ruby file\n```\nruby [filename]\n```\n\n### General commands\n```\nrails routes # List down all available routes.\n```\n\n## Section 2\n\n### What is Ruby? \n\nIt's a dynamic, OO, Open source programming language developed by Martz. Ruby is considered to follow the principle of POLA (principle of least astonishment). It means that the language behaves in such a way to minimize the confusion for experienced users. It has been for 20+ years. With rails, the popularity of Ruby increased.\n\n### Features\n* Pure OO Language\n* No multiple inheritance\n* Modules and Classes \n  - Modules contain only methods \n  - Supports mixings - Define methods inside modules and use as required them in classes\n* Loosely typed\n * When a method is called on an object, Ruby only looks up at the name irrespective of the type of object\n* Mutating constants wont stop the execution of the program\n* Naming:\n  - Constants start with capital letter\n  - Globals with $\n  - Instance var @\n  - Class var @@\n  - Method names usually follow snake case\n* Case sensitive\n\nHowever, JRuby and Rubinius, which are popular implementations of ruby are compiled\n1. Rubinius -COMPILES(Rubinius compiler)-\u003e BYTECODE -COMPILES(Rubinius JIT Compiler (C++)) @ Runtime-\u003e MACHINE CODE\n`rbx compile simple.rb -o simple.bytecode`\n2. JRuby - -COMPILES(JRuby compiler(Java)-\u003e BYTECODE -COMPILES(Execute bytecode using JVM (JAVA JIT Compiler (C))) @ Runtime-\u003e MACHINE CODE\n\n##### Usage\n```\nrvm jruby-head\nruby simple.rb\n```\n\n##### Running\n```\njrubyc simple.rb\nls # simple.class simple.rb\njavap -c simple.class \u003e simple.bytecode\n```\n[MORE](https://dzone.com/articles/ruby-inquiry-it-interpreted-or)\n\n##### Running rails tasks\n```\nrails --tasks # view all possible tasks\nrails [class_name]:[function_name] # run a task\n```\n\n## Section 3\n\nRuby\n----\n\n1. Ruby Variables\n*local*\n*global*\n*class*\n*instance*\n\n\n2. Strings\n* string.class - Type of String\n* string.methods - All methods \n* .to_s .nil? .empty? .exists? .length .reverse \n\n* `ctrl + l` will clear up irb\n* Strings are pass by value\n*  #{ } - Acts as a template string for interpolation\n* Single quotes doesn't work with interpinolation\n* Escape characters also doesn't work with single quotes\n* Empty spaces are counted as characters `\" \".nil? ` # false\n\n3. Conversions\n*  `.to_s .to_i .to_f .odd? .even? .round`\n\n4. Methods and branching\n* Return is implicit\n\n5. Comments\n* Hash for single line comment\n* Multi line comments\n```\n=begin\n=end\n```\n## Section 4\n\nRuby Style Conventions\n----------------------\n* Model Name: Singular, First letter upper case.\n* Table Name: Plural, lower case model name \n* Model File: Snake case\n* Controller file: Snake Case\n* Classes: Pascal case\nMore @ [git](https://github.com/rubocop-hq/ruby-style-guide)\n\n## Section 5\n\nArchitecture\n------------\nRails framework follows the MVC architecture. \n\u003cbr\u003e\n\u003cimg src=\"http://ptgmedia.pearsoncmg.com/images/chap2_9780134077703/elementLinks/hartl_fig02-07_alt.jpg\"\u003e\n\u003cbr\u003e\nThe data flow will be as follows\n1. Call the route\n2. Controller \n3. Model *Optional*\n4. Database *Optional*\n5. View\n \n ## Section 6\n\nCommon errors in Ruby are;\n```\nNameError: uninitialized constant []\nNameError: uninitialized constant Object::Something\n```\n* Ruby is case sensitive.\n\n##### Uninitialized constant\n* Extends from NameError exception class\n* Thrown when the code refers to an unknown variable (The code can't resolve)\n* Classes start with upper case letters, instance variables or class variables start with lower case, Therefore it can be a side effect of misusing.\n\n\n## Section 7\n\nRails Router has the following types\n1. Collection routes (Index action) - Used to show a collection of items \n/articles\n2. Member routes (show action) - Used to show a specific item \n/articles/:id\n\nYou can setup the root route to goto any route.\n```\nroot articles#index\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frama41222%2Fruby-footprints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frama41222%2Fruby-footprints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frama41222%2Fruby-footprints/lists"}