A controller's purpose is to receive specific requests for the application.
New item has been created. View it here
1More
Gobot - 0 views
-
Gobot is set of libraries in the Go programming language for robotics and physical computing. It provides a simple, yet powerful way to create solutions that incorporate multiple, different hardware devices at the same time. Want to use Ruby on robots? Check out our sister project Artoo (http://artoo.io). Want to use Node.js? Check out our sister project Cylon (http://cylonjs.com).
]project-open[ - Enterprise Project Management, IT Service Management, PSA - 0 views
Smartcropper for Ruby - 0 views
Codebrawl: Content-aware image cropping with ChunkyPNG - 0 views
58More
Getting Started with Rails - Ruby on Rails Guides - 0 views
- ...55 more annotations...
-
view templates are written in a language called ERB (Embedded Ruby) which is converted by the request cycle in Rails before being sent to the user.
-
routing file which holds entries in a special DSL (domain-specific language) that tells Rails how to connect incoming requests to controllers and actions.
-
You can create, read, update and destroy items for a resource and these operations are referred to as CRUD operations
-
If not found, then it will attempt to load a template called application/new. It looks for one here because the PostsController inherits from ApplicationController
-
:formats specifies the format of template to be served in response. The default format is :html, and so Rails is looking for an HTML template.
-
When you call form_for, you pass it an identifying object for this form. In this case, it's the symbol :post. This tells the form_for helper what this form is for.
-
parameters can then be referenced inside the controller actions, typically to perform a particular task
-
Rails uses rake commands to run migrations, and it's possible to undo a migration after it's been applied to your database
-
every Rails model can be initialized with its respective attributes, which are automatically mapped to the respective database columns.
-
The action defined in this method is also reversible, which means Rails knows how to reverse the change made by this migration, in case you want to reverse it later
-
Migration filenames include a timestamp to ensure that they're processed in the order that they were created.
-
prevents an attacker from setting the model's attributes by manipulating the hash passed to the model.
-
If you want to link to an action in the same controller, you don't need to specify the :controller option, as Rails will use the current controller by default.
-
Active Record supplies a great deal of functionality to your Rails models for free, including basic database CRUD (Create, Read, Update, Destroy) operations, data validation, as well as sophisticated search support and the ability to relate multiple models to one another.
-
Rails can validate a variety of conditions in a model, including the presence or uniqueness of columns, their format, and the existence of associated objects.
-
Each request for a comment has to keep track of the post to which the comment is attached, thus the initial call to the find method of the Post model to get the post in question.
-
pluralize is a rails helper that takes a number and a string as its arguments. If the number is greater than one, the string will be automatically pluralized.
-
The render method is used so that the @post object is passed back to the new template when it is rendered.
-
The method: :patch option tells Rails that we want this form to be submitted via the PATCH HTTP method which is the HTTP method you're expected to use to update resources according to the REST protocol.
-
The :method and :'data-confirm' options are used as HTML5 attributes so that when the link is clicked, Rails will first show a confirm dialog to the user, and then submit the link with method delete. This is done via the JavaScript file jquery_ujs which is automatically included into your application's layout (app/views/layouts/application.html.erb) when you generated the application.
-
standard CRUD actions in each controller in the following order: index, show, new, edit, create, update and destroy.
36More
shared by 張 旭 on 22 Jan 14
- No Cached
Active Record Basics - Ruby on Rails Guides - 0 views
guides.rubyonrails.org/active_record_basics.html
ruby rails programming development framework model database object

-
Active Record facilitates the creation and use of business objects whose data requires persistent storage to a database
- ...33 more annotations...
-
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
-
The idea is that if you configure your applications in the very same way most of the times then this should be the default way.
-
Primary keys - By default, Active Record will use an integer column named id as the table's primary key
-
Validation is a very important issue to consider when persisting to database, so the methods create, save and update take it into account when running: they return false when validation fails and they didn't actually perform any operation on database.
-
-
9More
plataformatec/devise: Flexible authentication solution for Rails with Warden. - 0 views
-
If you are building your first Rails application, we recommend you do not use Devise. Devise requires a good understanding of the Rails Framework
- ...6 more annotations...
-
Replace MODEL with the class name used for the application’s users (it’s frequently User but could also be Admin)
-
If you add an option, be sure to inspect the migration file (created by the generator if your ORM supports them) and uncomment the appropriate section
-
when using a :user resource, the user_root_path will be used if it exists; otherwise, the default root_path will be used
17More
Active Record Migrations - Ruby on Rails Guides - 0 views
-
On databases that support transactions with statements that change the schema, migrations are wrapped in a transaction
- ...14 more annotations...
13More
Understanding Ruby Blocks, Procs and Lambdas - Robert Sosinski - 0 views
- ...10 more annotations...
-
use the yield keyword. Calling this keyword will execute the code within the block provided to the method
-
The only difference between blocks and Procs is that a block is a Proc that cannot be saved, and as such, is a one time use solution
20More
OmniAuth: Overview · plataformatec/devise Wiki - 0 views
- ...17 more annotations...
-
The symbol passed to the user_omniauth_authorize_path method matches the symbol of the provider passed to Devise's config block
-
After inserting their credentials, they will be redirected back to your application's callback method
-
All information retrieved from Facebook by OmniAuth is available as a hash at request.env["omniauth.auth"]
-
Devise removes all the data starting with "devise." from the session whenever a user signs in, so we get automatic session clean up
-
We pass the :event => :authentication to the sign_in_and_redirect method to force all authentication callbacks to be called
-
Devise's RegistrationsController by default calls "User.new_with_session" before building a resource
-
if we need to copy data from session whenever a user is initialized before sign up, we just need to implement new_with_session in our model
1More
Supervisor: A Process Control System - supervisor 3.1a1-dev documentation - 1 views
-
Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems. It shares some of the same goals of programs like launchd, daemontools, and runit. Unlike some of these programs, it is not meant to be run as a substitute for init as "process id 1". Instead it is meant to be used to control processes related to a project or a customer, and is meant to start like any other program at boot time.
croppic - 0 views
產品說明 - 0 views
PHP-FIG - PHP Framework Interop Group - 0 views
View AllMost Active Members
View AllTop 10 Tags
- 151system
- 133programming
- 102docker
- 101rails
- 89development
- 83devops
- 81kubernetes
- 80javascript
- 77database
- 71ruby
- 68linux
- 64web
- 61server
- 58networking
- 52security
- 49python
- 42mysql
- 42php
- 40framework
- 35performance