#Rubydocs
Explore tagged Tumblr posts
Photo
blue lace agate update!
8 notes
·
View notes
Text
RECOVERY
Chapter 1, page 1 and 2

Iolite a gem from Blue Diamond 's court is waiting on a line to talk to the Diamond about the rebel gems that he shattered with the body mastery power ( Ability to control the body of a gem against itself) that is unique from his kind of gem. While he waited a Padparadsha Sapphire appears and that's how Iolite's life changed forever.
TO BE CONTINUED...
.
Pages 3 and 4
Pages 5 and 6
Pages 7 and 8
.
Credits:
Title made by @saucryognathus
Gemsonas on the line are from: @cateyecian220 and @rubydoc-ruan
( reblogs are appreciated)
( don't use my art without my permission please)
#gem fusion#steven universe future#suf#artists on tumblr#gemsona#fan fusion#comic#hq#gemsona fusions#su steven#padparascha steven universe#steven universe#blue diamond#iolite#padparadsha#padparascha sapphire#padparascha su#crystal gems#crystals#gemstones#gem war
75 notes
·
View notes
Text
Ok so! I'm back to making episodes. This time they will be better than the last ones. I am allowing 5 different gemsonas into the show. All you need to do is reblog with a picture of your gemsona.
SPOTS
@dailygemsonas blue neon pearl
@forestemeraldsu forest emerald
@cosmicxflare charoite
@rubydoc-ruan lapis lazuli
@io-arts bumblebee jasper
36 notes
·
View notes
Text
NEW VIDEO
Fanfusion with @rubydoc-ruan
Lápis+ruby=hackmanite
.
.
.
5 notes
·
View notes
Text
Ruby on Rails - The Basics
In this article, we will see the major concepts and basic structure of the rails framework.
Rails is a web application development framework written in the Ruby programming 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.
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.
Here is a basic design pattern which demonstrates how we can achieve this:-
For the purpose of reusability and keeping the controllers sleek we create services. Mostly services handles the particular task and provide the end response to the controllers
For the purpose of keeping the models sleek and reusable we create concerns
It’s best if we do not write ruby code in the view files but in case we need to then we will take the help of helpers and we tend to write such functions those can be used on multiple places
Create a common controller which is inherited by other controllers with the name application controller and which inherits its properties from action controller
Convention Over Configuration: Rails has opinions about the best way to do many things in a web application. If you follow the conventions defined by the rails framework then the development would be very fast instead of updating the configuration of the framework according to you.
Here are some examples how rails achieve this :-
If we have a table with name users then we will create a model file with name user.rb in models folder
If the request goes to users controller and index function then the view file will be present in views > users with the index.html.erb or index.html.haml
Let’s first see the structure of rails application
When you create new rails application with the command
rails new <app-name>
You will get a predefined folder structure of the rails framework. Let's discuss the most used folders of the framework and their purpose
app − It organizes your application components. It's got subdirectories that hold the view (views and helpers), controller (controllers), and the backend business logic (models).
app/controllers − The controllers subdirectory is where Rails looks to find the controller classes. A controller handles a web request from the user.
Note - Ideally your controller should not be used for writing any major code, it is just used for the handling of the requests
app/helpers − The helpers subdirectory holds any helper classes used to assist the model, view, and controller classes. This helps to keep the model, view, and controller code small, focused, and uncluttered.
app/models − The models subdirectory holds the classes that model and wrap the data stored in our application's database. In most frameworks, this part of the application can grow pretty messy, tedious, verbose, and error-prone. Rails makes it dead simple!
app/view − The views subdirectory holds the display templates to fill in with data from our application, convert to HTML, and return to the user's browser.
app/view/layouts − Holds the template files for layouts to be used with views. This models the common header/footer method of wrapping views. In your views, define a layout using the <tt>layout:default</tt> and create a file named default.html.erb. Inside default.html.erb, call <% yield %> to render the view using this layout.
components − This directory holds components, tiny self-contained applications that bundle model, view, and controller.
config − This directory contains the small amount of configuration code that your application will need, including your database configuration (in database.yml), your Rails environment structure (environment.rb), and routing of incoming web requests (routes.rb). You can also tailor the behavior of the three Rails environments for test, development, and deployment with files found in the environments directory.
db − Usually, your Rails application will have model objects that access relational database tables. You can manage the relational database with scripts you create and place in this directory.
db/migration - Contains the migration files
db/schema.rb - Schema of whole application
db/seed.rb - Seed data for the application
doc − Ruby has a framework, called RubyDoc, that can automatically generate documentation for code you create. You can assist RubyDoc with comments in your code. This directory holds all the RubyDoc-generated Rails and application documentation.
lib − You'll put libraries here, unless they explicitly belong elsewhere (such as vendor libraries).
log − Error logs go here. Rails creates scripts that help you manage various error logs. You'll find separate logs for the server (server.log) and each Rails environment (development.log, test.log, and production.log).
public − Like the public directory for a web server, this directory has web files that don't change, such as JavaScript files (public/javascripts), graphics (public/images), stylesheets (public/stylesheets), and HTML files (public).
script − This directory holds scripts to launch and manage the various tools that you'll use with Rails. For example, there are scripts to generate code (generate) and launch the web server (server).
test − The tests you write and those that Rails creates for you, all goes here. You'll see a subdirectory for mocks (mocks), unit tests (unit), fixtures (fixtures), and functional tests (functional)
tmp − Rails uses this directory to hold temporary files for intermediate processing.
vendor − Libraries provided by third-party vendors (such as security libraries or database utilities beyond the basic Rails distribution) go here
Apart from this there are some important files
Gemfile - Here we will define the third party dependencies needed by the system
Gemfile.lock - Lock file of dependencies
Request Lifecycle
For each request we will create a route in route.rb or in routes > web.rb in new rails applications which is placed in the config folder. From here we route our request to particular controller and it’s method. There we will handle that request.
If database interaction is needed then it will call model methods and get the data and render the view, otherwise directly render the view file.

Now let’s discuss main features of rails framework
Active Record - Active Record is the M in MVC - the model - which is the layer of the system responsible for representing business data and logic. Active Record facilitates the creation and use of business objects whose data requires persistent storage to a database. It is an implementation of the Active Record pattern which itself is a description of an Object Relational Mapping system.
Object Relational Mapping - Commonly referred to as its abbreviation ORM, is a technique that connects the rich objects of an application to tables in a relational database management system. Using ORM, the properties and relationships of the objects in an application can be easily stored and retrieved from a database without writing SQL statements directly and with less overall database access code.
Migration - Rails provides a domain-specific language for managing a database schema called migrations. Migrations are stored in files which are executed against any database that Active Record supports using rake.
Basically we create and update database structure in rails with the help of migrations. There are some other benefits like we do not have to share any structure change to the team members, it automatically handles that.
Associations - In Rails, an association is a connection between two Active Record models. Why do we need associations between models? Because they make common operations simpler and easier in your code.
Rails supports six types of associations:
belongs_to - A belongs_to association sets up a one-to-one connection with another model, such that each instance of the declaring model "belongs to" one instance of the other model. For example, if your application includes authors and books, and each book can be assigned to exactly one author
has_one - A has_one association also sets up a one-to-one connection with another model, but with somewhat different semantics (and consequences). This association indicates that each instance of a model contains or possesses one instance of another model. For example, if each supplier in your application has only one account
has_many - A has_many association indicates a one-to-many connection with another model. You'll often find this association on the "other side" of a belongs_to association. This association indicates that each instance of the model has zero or more instances of another model. For example, in an application containing authors and books
has_many :through - A has_many :through association is often used to set up a many-to-many connections with another model. This association indicates that the declaring model can be matched with zero or more instances of another model by proceeding through a third model. For example, consider a medical practice where patients make appointments to see physicians.
has_one :through - A has_one :through association sets up a one-to-one connection with another model. This association indicates that the declaring model can be matched with one instance of another model by proceeding through a third model. For example, if each supplier has one account, and each account is associated with one account history
has_and_belongs_to_many - A has_and_belongs_to_many association creates a direct many-to-many connections with another model, with no intervening model. For example, if your application includes assemblies and parts, with each assembly having many parts and each part appearing in many assemblies
2 notes
·
View notes
Text
Let's mash it up!
Slots
@neoryanvx1
@dailygemsonas
@rubydoc-ruan
@pastel-reblogs
@gem329
Information
Ok so I'm letting 5 people fuse with my lavender pearl. Reblog this post with a png of your gemsona. Once I see you've entered, I'll add your name to the list.
!FULL!
28 notes
·
View notes