Posts

Showing posts with the label CRUD

RESTful with RoR

Image
Greetings Mate!!! In this article,   you'll learn about REST and how Rails implements it.   REST is a tricky subject in beginner   Ruby on Rails training.   On one hand, it requires learning   some advanced web concepts and new techniques   at a time when you're still getting   your footing in the basics of MVC and CRUD.   But on the other hand,   REST has become such a core part   of developing in Rails that you must learn it.   So hang with article as you go into some deeper waters.   REST is short for Representational State Transfer ,   and REST is a design concept   which says that our application   should not focus on performing procedures,   but instead on performing   state transformations upon resources. It's not easy to see how that's   different from what we're already doing   because the Rails MVC pattern   already encourages us to break up our code   by model and c...

CRUD Basics

Image
Greetings of the day!!! In this article,   you will see several concepts   which are important for the design of Rails applications.   These concepts will affect the way that we work with URLs,   how we write controller code,   and how our controllers manage our models and database data.   We're gonna start by talking about the concept of CRUD.   Let's begin with reviewing the MVC web architecture diagram.   You must learned how to use controllers and views   to create dynamic pages and return them back to the browser.   Next, learned to interact   with the database by creating models and associations. MVC Architecture And worked with those, not from a browser,   but via the Rails console would be feasible.   Now, we need to put the two together   and learn how to work with the models   inside our controllers.   Then we'll be able to manipulate   our database data from the browser, ...

ActiveRecords and ActiveRelation

Image
Good to see you, Geek!!! This blog page will help you to understand ActiveRecord and ActiveRelation. ActiveRecord and ActiveRelation are part of the Rails framework that's going to power your models. So before you begin coding on your models get a big picture understanding of how they work.  Active Record Active record, when it's written all lowercase as two separate words refer to a commonly used design pattern for working with relational databases. It's not Rail specific. You could use the active record pattern in any programming language. It's an approach to designing object-oriented software.  ActiveRecord, when it's written as one word with a capital A and R, refers to the Rails implementation of the active record pattern. Often you can use the terms interchangeably but it's helpful to understand the context and to know the difference. The ActiveRecord design pattern allows you to retrieve database data as objects. And then to wor...