Saturday, March 19, 2016

Creating the First Application Ruby on Rails

Creating the First Application Ruby on Rails

Creating the First Application Ruby on Rails. The best way to use this guide is to follow each step as it happens, no code or step needed to make this example application has been left out, so you can literally follow along step by step.

By following along with this guide, you'll create a Rails project called blog, a (very) simple weblog. Before you can start building the application, you need to make sure that you have Rails itself installed.

Installing Rails

Open up a command line prompt. On Mac OS X open Terminal.app, on Windows choose "Run" from your Start menu and type 'cmd.exe'. Any commands prefaced with a dollar sign $ should be run in the command line. Verify that you have a current version of Ruby installed:
A number of tools exist to help you quickly install Ruby and Ruby on Rails on your system. Windows users can use Rails Installer, while Mac OS X users can use Tokaido.
Baca selengkapnya

Thursday, March 17, 2016

Pagination Rails using Kaminari gem

When we work with just couple of records, it's easy to simply list them all on the index page. But, what happens when we have more than two, let's say 100 records? What if we have 1000? How about 1 million? If we try to list all records from the database on a website at once, not only it will be a lot of load on the database, download will take much longer time, but it's likely that user's browser will crash.

Step 1: Add Kaminari and Bundle Gems

First, add kaminari to the Gemfile


gem 'kaminari'

gem 'kaminari-bootstrap'

because we use bootstrap for style, so kaminari-bootstrap are nicely styled.

$ bundle install

Baca selengkapnya

Sunday, March 13, 2016

Introduction

Introduction

1. Intro

This website is designed for medium ruby on rails tutorial. Contains articles, tutorials, tips and tricks ruby on rails from my own experience or from several websites on the internet.
Learning to build a modern web application is daunting. Ruby on Rails makes it much easier and more fun. It includes everything you need to build fantastic applications, and you can learn it with the support of our large, friendly community.

Ruby on Rails is open source software, so not only is it free to use, you can also help make it better. More than 4,200 people already have contributed code to Rails. It’s easier than you think to become one of them.
 "quoted from the official web ruby on rails"

2. What is Rails?

Rails is a web application development framework written in the Ruby language. It is designed to make programming web applications easier by making assumptions about what every developer needs to get started. It allows you to write less code while accomplishing more than many other languages and frameworks. Experienced Rails developers also report that it makes web application development more fun.

Rails is opinionated software. It makes the assumption that there is the "best" way to do things, and it's designed to encourage that way - and in some cases to discourage alternatives. If you learn "The Rails Way" you'll probably discover a tremendous increase in productivity. If you persist in bringing old habits from other languages to your Rails development, and trying to use patterns you learned elsewhere, you may have a less happy experience.

The Rails philosophy includes two major guiding principles:

  • Don't Repeat Yourself: DRY is a principle of software development which states that "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." By not writing the same information over and over again, our code is more maintainable, more extensible, and less buggy.
  • Convention Over Configuration: Rails has opinions about the best way to do many things in a web application, and defaults to this set of conventions, rather than require that you specify every minutiae through endless configuration files.


So, Keep up date with me and with ruby on rails.
Baca selengkapnya