The document discusses Rails MVC architecture and its key components. It describes how the MVC pattern separates an application into the model, view, and controller components. It then provides examples of how routing, controllers, models, views, and layouts work in Rails applications to implement the MVC pattern.
Cape Town MS Developer User Group: Xamarin Community ToolkitJavier Suárez Ruiz
In this session we are going to talk about the Xamarin Community Toolkit, a collection of Animations, Behaviors, Converters Effects and Controls for mobile development with Xamarin.Forms.
We will see what it gives us, how to use it and also how you can contribute!
Monkey Conf 2020: Xamarin Community Toolkit: More possibilities with Xamarin....Javier Suárez Ruiz
In this session we are going to know the Xamarin Community Toolkit (XCT) along with all the options it offers like controls, converters, behaviors, etc.
Cape Town MS Developer User Group: Xamarin Community ToolkitJavier Suárez Ruiz
In this session we are going to talk about the Xamarin Community Toolkit, a collection of Animations, Behaviors, Converters Effects and Controls for mobile development with Xamarin.Forms.
We will see what it gives us, how to use it and also how you can contribute!
Monkey Conf 2020: Xamarin Community Toolkit: More possibilities with Xamarin....Javier Suárez Ruiz
In this session we are going to know the Xamarin Community Toolkit (XCT) along with all the options it offers like controls, converters, behaviors, etc.
CRUD, form management, and how Dojo solves it. It was delivered at ClubAJAX on 12/2/2009. Blog post: http://lazutkin.com/blog/2009/dec/2/crud-with-dojo/
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Drupal 8 ha llegado con un montón de novedades. Tras poner en producción mi primer proyecto en Drupal 8, presento algunas de las cosas que he aprendido durante el desarrollo y que me han hecho perder tiempo.
Hablo de Render API, Form API, Dependency injection, CMI y algunas otras cosillas de introducción.
Las diapositivas están repletas de código de ejemplo de cada cosa.
Charla impartida en las oficinas de Idealista para el grupo Drupal Madrid en Marzo de 2016.
In this session, we will examine the basics of the SpringSurf view composition framework for Spring MVC applications. It will show how to easily construct pages, templates and components.
Empowering users: modifying the admin experienceBeth Soderberg
One of our goals as WordPress developers should be to build user friendly websites and admin interfaces. In many cases once we’ve added custom post types, taxonomies, plugins, and other features required by a site’s design and structure, the WordPress admin panel can become unwieldy and may be confusing to site managers. In this session we’ll explore a number of strategies and techniques that will help make site administration an empowering experience for your clients. We’ll discuss modification of the admin panel, strategic use of custom fields, managing permissions, use of labels and help text, and more, all with the goal of making hand offs to non-technical website managers stress free.
PrimeFaces, JavaServer Faces icin gelistirllen ve dunya capinda populer olan zengin bir arayuz kutuphanesidir. Bu sunumda PrimeFaces Bilesenleri, Mobil, Ajax Push, Tema Destegi gibi modullerin yani sira PrimeFaces ekibinin gelistirdigi yeni jQuery javascript kutuphanesi PrimeUI'da tanitilmaktadir.
There are a number of ways to add custom meta boxes to WordPress admin, from coding against core functions through code API frameworks to GUI interfaces. All of these have a place, but which is the right one for your project, code style and coding level? In this talk I will provide code examples and illustrations of the code techniques for each of the methods.
Time permitting, I will also show you how to extend the frameworks.
Aimed at all levels of developer because of the range of options covered.
As present at FluentConf 2014 on March 11th, 2014.
AngularJS is one of the most popular, and powerful, JavaScript frameworks for building rich client-side applications. AngularJS is both simultaneously both simple to use and extremely full featured. With AngularJS a little goes a long way, but to make the most of it, you need to know what you’re doing.
In this workshop we will build a complex application to help exercise all of the salient points of the AngularJS framework.
Topics covered include, ngResource, directives, fitlers, routing, templates, controllers, testing, and more.
Code can be found at: https://github.com/markbates/fluent-2014
CRUD, form management, and how Dojo solves it. It was delivered at ClubAJAX on 12/2/2009. Blog post: http://lazutkin.com/blog/2009/dec/2/crud-with-dojo/
Building Single Page Application (SPA) with Symfony2 and AngularJSAntonio Peric-Mazar
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. How to connect Symfony2 as backend and AngularJS as frontend solution? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Drupal 8 ha llegado con un montón de novedades. Tras poner en producción mi primer proyecto en Drupal 8, presento algunas de las cosas que he aprendido durante el desarrollo y que me han hecho perder tiempo.
Hablo de Render API, Form API, Dependency injection, CMI y algunas otras cosillas de introducción.
Las diapositivas están repletas de código de ejemplo de cada cosa.
Charla impartida en las oficinas de Idealista para el grupo Drupal Madrid en Marzo de 2016.
In this session, we will examine the basics of the SpringSurf view composition framework for Spring MVC applications. It will show how to easily construct pages, templates and components.
Empowering users: modifying the admin experienceBeth Soderberg
One of our goals as WordPress developers should be to build user friendly websites and admin interfaces. In many cases once we’ve added custom post types, taxonomies, plugins, and other features required by a site’s design and structure, the WordPress admin panel can become unwieldy and may be confusing to site managers. In this session we’ll explore a number of strategies and techniques that will help make site administration an empowering experience for your clients. We’ll discuss modification of the admin panel, strategic use of custom fields, managing permissions, use of labels and help text, and more, all with the goal of making hand offs to non-technical website managers stress free.
PrimeFaces, JavaServer Faces icin gelistirllen ve dunya capinda populer olan zengin bir arayuz kutuphanesidir. Bu sunumda PrimeFaces Bilesenleri, Mobil, Ajax Push, Tema Destegi gibi modullerin yani sira PrimeFaces ekibinin gelistirdigi yeni jQuery javascript kutuphanesi PrimeUI'da tanitilmaktadir.
There are a number of ways to add custom meta boxes to WordPress admin, from coding against core functions through code API frameworks to GUI interfaces. All of these have a place, but which is the right one for your project, code style and coding level? In this talk I will provide code examples and illustrations of the code techniques for each of the methods.
Time permitting, I will also show you how to extend the frameworks.
Aimed at all levels of developer because of the range of options covered.
As present at FluentConf 2014 on March 11th, 2014.
AngularJS is one of the most popular, and powerful, JavaScript frameworks for building rich client-side applications. AngularJS is both simultaneously both simple to use and extremely full featured. With AngularJS a little goes a long way, but to make the most of it, you need to know what you’re doing.
In this workshop we will build a complex application to help exercise all of the salient points of the AngularJS framework.
Topics covered include, ngResource, directives, fitlers, routing, templates, controllers, testing, and more.
Code can be found at: https://github.com/markbates/fluent-2014
Rails Antipatterns (http://www.amazon.com/Rails-AntiPatterns-Refactoring-Addison-Wesley-Professional/dp/0321604814) 를 읽고 몇 가지 정도만 요약을 해보았습니다.
레일즈를 시작한지 얼마 되지 않은터라 맞지 않는 부분이 있더라도 양해 부탁드려요 :)
The world of JavaScript client-side frameworks is overflowing with contenders vying for the crown, but which one do you choose for your next project? Which one has what it takes?
In this talk we’ll look at the “Big 3”, AngularJS, Ember.js, and Backbone.js. We’ll compare them head to head, toe to toe. We’ll look at the pros and cons of each one. How do they handle form bindings? Talking to APIs? Code organization? Routing? Etc?
Who’ll come out victorious in this battle of the JavaScript frameworks, or will we all just come out bloodied and bruised on the other side? Guess we’ll find out!
En esta platica trate de transmitir mejores practicas que se deben tener en cuenta cuando se diseña una API, y como ruby on rails te podria ayudar a desarrollarla en muy poco tiempo
With third party clients connecting to your service you may find that the assumptions or opinions of a typical rails application are not robust enough. We'll run through some key considerations when building an API that will be consumed by a mobile app.
Lisp(Lots of Irritating Superfluous Parentheses)Pivorak MeetUp
My presentation is about Lisp, and its influences on ruby language.
Also speak about Lambda calculus and Turing machine. This is crucial for Lisp origins understanding.
Show major Lisp dialects. And speak a little about Emacs and Emacs Lisp.
Also I going to show project management in Common Lisp and describe CLOS (Common Lisp Object System).
Business-friendly library for inter-service communicationPivorak MeetUp
I’m going to share the experience of creating a platform-level client library for communication between internal services.
The talk partially covers topology and protocols related decisions we made.
But the main focus is the Ruby library that defines the inter-service communication framework using business-related abstractions.
Sergiy Kukunin has 9 years of Web Development career and 4 of them - with Ruby. Now he is freelancing and owns a tattoo studio. But the story he is gonna share with us this time is about being a Team Leader - all from a personal experience.
Ever wanted to lead a team?
Hear his sincere story, practical advice and tips how not to screw up.
The Saga Pattern: 2 years later by Robert PankoweckiPivorak MeetUp
When you split your application into multiple module how do you make them talk to each other? How do you make them react to changes happening in other parts of the system? How do you make them tell each other that something needs to be done? When should it happen? We will have a look what we can squeeze out of domain events being published in various parts of our application and how we can use them to orchestrate a bigger business process.
Data and Bounded Contexts by Volodymyr BynoPivorak MeetUp
Just a small talk about data segregation/modularity from the DDD perspective. It might be interesting for engineers that have to deal with the huge projects. Especially ones that are looking forward to visiting DDD workshop.
Successful Remote Development by Alex RozumiiPivorak MeetUp
More about his talk :
"You've most likely already heard something about remote work. While the concept is not that old, it's a trend that many well-known brands are implementing.
In this presentation, you'll learn the essentials and seldom thought of pitfalls about remote work. These are based on the speaker's experience working remotely for more than two years. Many of these lessons were gained while working at Toptal, a company whose whole business model is built around remote work."
Eugene Pirogov talks about “Origins of Elixir” during #pivorak Lviv Ruby MeetUp 2016
Details:
“For the past 6 years I've been programming in Ruby. Began shifting from Ruby to Elixir during a sabbatical. Started doing programming exercises in Elixir as well as contributing to Elixir language and variety of small libraries in the ecosystem. I'm a strong believer that Elixir, being backed by immensely powerful, robust and battle-tested Erlang VM will take over the world of web development.” - that’s what Eugene says.
The talk will be about solving CSS issues in big projects by adopting Functional CSS methodology.
You will learn how to take best ideas from Functional Programming, and apply them to your CSS codebase. This means side-effects are limited or nonexistent, already created classes can't be overridden because they are immutable and they are trying to be as "pure" as it's possible to achieve in CSS.
Multi language FBP with Flowex by Anton Mishchuk Pivorak MeetUp
The talk is about Flow-Based programming (FBP) using Flowex library built on top of Elixir GenStage feature.
You will find out about Flowex Railway-FBP design approach, about its abstractions, and the way to easily create pipelines of independent components.
Our speaker Anton also demonstrates how one can use Ruby, Python, and, in general, any other programming language inside Flowex pipes and therefore create reusable components with language-specific functionality.
About the speaker:
Anton Mishchuk is an experienced Ruby developer with more than 6 years in business). Now he’s working with Matic Insurance.
For the last 3 years his main addiction has been Elixir: “I’m happy with actors model of concurrency and functional programming. I have a couple of open-source projects written in Elixir - BDD testing library - ESpec and Flowex.”
Watch video of Anton's talk given at #pivorak here - https://www.youtube.com/watch?v=RY9THv-yosI
CryptoParty: Introduction by Olexii MarkovetsPivorak MeetUp
Olexii, what’s your topic exactly about?
This is about CryptoParty: decentralized movement with the goal to pass on knowledge about protecting yourself in the digital space.
I will try to give general overview on what CryptoParty is, why would anyone care about privacy on the internet and what is common topics covered during CryptoParty.
For whom will it be a useful topic?
Anyone, actually anyone, no technical background is required.
About Olexii:
"I’m a programmer. I write code. Mostly I’m involved in Linux system programming. I like to think that I’m quite good in C++. Currently, privacy and anonymity on the internet is one of the topics on which I spend my spare time."
Olexii introduced some of us to CryptoParty last Summer (the first time in Ukraine, woah!), but it’s time to share the ideas with the wider audience.
How to make first million by 30 (or not, but tryin') - by Marek PiaseckiPivorak MeetUp
This time Marek won’t be talking about what’s wrong with frameworks, because you can read it in his blog - http://bit.ly/2jSN0z4.
But about progressing career - strategy, negotiations, self development. And it will be his own story.
It should be interesting for anyone who cares about career/money - not only Ruby Devs.
Marek is from Poland, but now he works as a contractor in Rome for International Fund for Agricultural Development (IFAD) - which is United Nations agency. I’m using Rails of course :)” - he says.
Marek was our Lightning Talker last April about anti-frameworks. Please, check out his talk here emoji unicode: 1f3a5emoji unicode: 1f449 https://youtu.be/QsAArlQnktI
Oleksandr gives a Lightning talk about GIS integration: Storing and displaying geospatial data using OpenGeo Suite.
I would tell about:
- GIS itself;
- open source software called OpenGeo Suite;
- Geo spatial data representation in Geoserver (shapefiles and postgresql databases with postgis extension);
- Scalable data import using rest api.
Finally i would present the way to serve stored data using Open Layers.
This topic might be useful for Ruby Devs, GIS enthusiasts that are looking for free and powerful tools and other Backend devs.
Unikernels - Keep It Simple to the Bare MetalPivorak MeetUp
In this presentation Tomek Kalinowski introduces the Audience to the idea of “Library Operating System” and its modern extension - The Unikernel.
In short unikernel is another way of packaging and deploying code in which everything, including operating system, is tailored to serve your code’s single purpose (like displaying random cat pictures).
We'll try to answer the questions:
- Why and when it can be useful?
- Is this reusable? Interoperable?
- How we can leverage virtualization?
And last, but not least, is this the answer for inevitable coming of our Lord and Savior FPGA?
OpenMetadata Community Meeting - 5th June 2024OpenMetadata
The OpenMetadata Community Meeting was held on June 5th, 2024. In this meeting, we discussed about the data quality capabilities that are integrated with the Incident Manager, providing a complete solution to handle your data observability needs. Watch the end-to-end demo of the data quality features.
* How to run your own data quality framework
* What is the performance impact of running data quality frameworks
* How to run the test cases in your own ETL pipelines
* How the Incident Manager is integrated
* Get notified with alerts when test cases fail
Watch the meeting recording here - https://www.youtube.com/watch?v=UbNOje0kf6E
May Marketo Masterclass, London MUG May 22 2024.pdfAdele Miller
Can't make Adobe Summit in Vegas? No sweat because the EMEA Marketo Engage Champions are coming to London to share their Summit sessions, insights and more!
This is a MUG with a twist you don't want to miss.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Graspan: A Big Data System for Big Code AnalysisAftab Hussain
We built a disk-based parallel graph system, Graspan, that uses a novel edge-pair centric computation model to compute dynamic transitive closures on very large program graphs.
We implement context-sensitive pointer/alias and dataflow analyses on Graspan. An evaluation of these analyses on large codebases such as Linux shows that their Graspan implementations scale to millions of lines of code and are much simpler than their original implementations.
These analyses were used to augment the existing checkers; these augmented checkers found 132 new NULL pointer bugs and 1308 unnecessary NULL tests in Linux 4.4.0-rc5, PostgreSQL 8.3.9, and Apache httpd 2.2.18.
- Accepted in ASPLOS ‘17, Xi’an, China.
- Featured in the tutorial, Systemized Program Analyses: A Big Data Perspective on Static Analysis Scalability, ASPLOS ‘17.
- Invited for presentation at SoCal PLS ‘16.
- Invited for poster presentation at PLDI SRC ‘16.
Utilocate offers a comprehensive solution for locate ticket management by automating and streamlining the entire process. By integrating with Geospatial Information Systems (GIS), it provides accurate mapping and visualization of utility locations, enhancing decision-making and reducing the risk of errors. The system's advanced data analytics tools help identify trends, predict potential issues, and optimize resource allocation, making the locate ticket management process smarter and more efficient. Additionally, automated ticket management ensures consistency and reduces human error, while real-time notifications keep all relevant personnel informed and ready to respond promptly.
The system's ability to streamline workflows and automate ticket routing significantly reduces the time taken to process each ticket, making the process faster and more efficient. Mobile access allows field technicians to update ticket information on the go, ensuring that the latest information is always available and accelerating the locate process. Overall, Utilocate not only enhances the efficiency and accuracy of locate ticket management but also improves safety by minimizing the risk of utility damage through precise and timely locates.
Software Engineering, Software Consulting, Tech Lead, Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Transaction, Spring MVC, OpenShift Cloud Platform, Kafka, REST, SOAP, LLD & HLD.
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxrickgrimesss22
Discover the essential features to incorporate in your Winzo clone app to boost business growth, enhance user engagement, and drive revenue. Learn how to create a compelling gaming experience that stands out in the competitive market.
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteGoogle
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
👉👉 Click Here To Get More Info 👇👇
https://sumonreview.com/ai-pilot-review/
AI Pilot Review: Key Features
✅Deploy AI expert bots in Any Niche With Just A Click
✅With one keyword, generate complete funnels, websites, landing pages, and more.
✅More than 85 AI features are included in the AI pilot.
✅No setup or configuration; use your voice (like Siri) to do whatever you want.
✅You Can Use AI Pilot To Create your version of AI Pilot And Charge People For It…
✅ZERO Manual Work With AI Pilot. Never write, Design, Or Code Again.
✅ZERO Limits On Features Or Usages
✅Use Our AI-powered Traffic To Get Hundreds Of Customers
✅No Complicated Setup: Get Up And Running In 2 Minutes
✅99.99% Up-Time Guaranteed
✅30 Days Money-Back Guarantee
✅ZERO Upfront Cost
See My Other Reviews Article:
(1) TubeTrivia AI Review: https://sumonreview.com/tubetrivia-ai-review
(2) SocioWave Review: https://sumonreview.com/sociowave-review
(3) AI Partner & Profit Review: https://sumonreview.com/ai-partner-profit-review
(4) AI Ebook Suite Review: https://sumonreview.com/ai-ebook-suite-review
Hand Rolled Applicative User ValidationCode KataPhilip Schwarz
Could you use a simple piece of Scala validation code (granted, a very simplistic one too!) that you can rewrite, now and again, to refresh your basic understanding of Applicative operators <*>, <*, *>?
The goal is not to write perfect code showcasing validation, but rather, to provide a small, rough-and ready exercise to reinforce your muscle-memory.
Despite its grandiose-sounding title, this deck consists of just three slides showing the Scala 3 code to be rewritten whenever the details of the operators begin to fade away.
The code is my rough and ready translation of a Haskell user-validation program found in a book called Finding Success (and Failure) in Haskell - Fall in love with applicative functors.
Atelier - Innover avec l’IA Générative et les graphes de connaissancesNeo4j
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Allez au-delà du battage médiatique autour de l’IA et découvrez des techniques pratiques pour utiliser l’IA de manière responsable à travers les données de votre organisation. Explorez comment utiliser les graphes de connaissances pour augmenter la précision, la transparence et la capacité d’explication dans les systèmes d’IA générative. Vous partirez avec une expérience pratique combinant les relations entre les données et les LLM pour apporter du contexte spécifique à votre domaine et améliorer votre raisonnement.
Amenez votre ordinateur portable et nous vous guiderons sur la mise en place de votre propre pile d’IA générative, en vous fournissant des exemples pratiques et codés pour démarrer en quelques minutes.
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeAftab Hussain
Understanding variable roles in code has been found to be helpful by students
in learning programming -- could variable roles help deep neural models in
performing coding tasks? We do an exploratory study.
- These are slides of the talk given at InteNSE'23: The 1st International Workshop on Interpretability and Robustness in Neural Software Engineering, co-located with the 45th International Conference on Software Engineering, ICSE 2023, Melbourne Australia
Do you want Software for your Business? Visit Deuglo
Deuglo has top Software Developers in India. They are experts in software development and help design and create custom Software solutions.
Deuglo follows seven steps methods for delivering their services to their customers. They called it the Software development life cycle process (SDLC).
Requirement — Collecting the Requirements is the first Phase in the SSLC process.
Feasibility Study — after completing the requirement process they move to the design phase.
Design — in this phase, they start designing the software.
Coding — when designing is completed, the developers start coding for the software.
Testing — in this phase when the coding of the software is done the testing team will start testing.
Installation — after completion of testing, the application opens to the live server and launches!
Maintenance — after completing the software development, customers start using the software.
Mobile App Development Company In Noida | Drona InfotechDrona Infotech
Looking for a reliable mobile app development company in Noida? Look no further than Drona Infotech. We specialize in creating customized apps for your business needs.
Visit Us For : https://www.dronainfotech.com/mobile-application-development/
15. 1 Rails.application.routes.draw do
2 root 'home#index'
3
4 resources :events, only: %i[index show] do
5 resources :visit_requests, only: %i[show create destroy]
6 end
15
RESOURCES
16. CUSTOM ROUTES WITHIN RESOURCES
1 resources :orders do
2 collection do
3 post :search
4 end
5 member do
6 post :accept
7 post :reject
8 post :ship
9 get :despatch_note
10 end
11 end
16
17. get '/:page_url', to: 'pages#show'
authenticate :user, ->(u) { u.admin? } do
namespace :admin do
get '/', to: 'home#index'
resources :accounts
17
CUSTOM ROUTES, NAMESPACE
18. 1 # api
2 namespace :api, path: '/', constraints: { subdomain: 'api' }, defaults: { format: :json } do
3 namespace :v1 do
4 post 'sign_up' => 'registrations#create'
5 post 'sign_in' => 'sessions#create'
6 delete 'sign_out' => 'sessions#destroy'
7 end
8 end
18
NAMESPACES
api_v1_sign_up POST /v1/sign_up(.:format) api/v1/registrations#create
{:subdomain=>"api", :format=>:json}
api_v1_sign_in POST /v1/sign_in(.:format) api/v1/sessions#create
{:subdomain=>"api", :format=>:json}
api_v1_sign_out DELETE /v1/sign_out(.:format) api/v1/sessions#destroy
{:subdomain=>"api", :format=>:json}
19. 1 # api
2 scope :api, constraints: { subdomain: 'api' }, module: :api, defaults: { format: :json }, as: :api do
3 scope '/v1', module: :v1, as: :v1 do
4 post 'sign_up' => 'registrations#create'
5 post 'sign_in' => 'sessions#create'
6 delete 'sign_out' => 'sessions#destroy'
7 end
8 end
19
SCOPES
api_v1_sign_up POST /v1/sign_up(.:format) api/v1/registrations#create
{:subdomain=>"api", :format=>:json}
api_v1_sign_in POST /v1/sign_in(.:format) api/v1/sessions#create
{:subdomain=>"api", :format=>:json}
api_v1_sign_out DELETE /v1/sign_out(.:format) api/v1/sessions#destroy
{:subdomain=>"api", :format=>:json}
21. 1 # api
2 scope :api do
3 scope :v1 do
4 post 'sign_up' => 'registrations#create'
5 post 'sign_in' => 'sessions#create'
6 delete 'sign_out' => 'sessions#destroy'
7 end
8 end
21
SCOPES WITHOUT ANY OPTIONS
sign_up POST /sign_up(.:format) registrations#create
sign_in POST /sign_in(.:format) sessions#create
sign_out DELETE /sign_out(.:format) sessions#destroy
22. 22
NAMESPACE vs SCOPE
Namespace Scope
By default, adds the name of the
namespace to the name of the path,
prefixes actual request path, and expects
the controller to belong to appropriately
named module.
No defaults. All options are explicit.
A shortcut method when you need to
quickly nest a set of routes and controllers
under some name.
A powerful, customizable method to apply
defaults to a group of routes.
23. 1 namespace :admin do
2 root "admin#index"
3 end
4
5 root "home#index"
23
MULTIPLE ROOT ROUTES
35. class Goal < ApplicationRecord
has_many :donations, dependent: :destroy
end
class Donation < ApplicationRecord
belongs_to :goal
end
35
ONE TO MANY/ONE RELATIONS
Goal
id:integer
title:string
Donation
id:integer
goal_id:integer
title:string
...
...
36. 36
MANY TO MANY RELATIONS
Goal
id:integer
title:string
Donation
id:integer
title:string
... ...
class Goal < ApplicationRecord
has_and_belongs_to_many :donations
end
class Donation < ApplicationRecord
has_and_belongs_to_many :goal
end
donations_goals
goal_id:integer
donation_id:integer
40. 1 class Goal < ApplicationRecord
2 validates_associated :donations #(only in one of related model)
3 validates_with GoalValidator #class GoalValidator < ActiveModel::Validator
4 validate :expiration_date_cannot_be_in_the_past
5
6 def expiration_date_cannot_be_in_the_past
7 if expiration_date.present? && expiration_date < Date.today
8 errors.add(:expiration_date, "can't be in the past")
9 end
10 end
11 end
40
VALIDATES
51. class HomeController < ApplicationController
def index
render 'events/show'
end
end
51
LAYOUTS
class TalksController < ApplicationController
helper_method :talks, :talk, :tags
private
def talks
scope = Talk.published.includes(:event).order('events.finished_at desc')
@talks ||= params[:tag] ? scope.tagged_with(params[:tag]) : scope
@talks.page(params[:page]).per(12)
end
end
class PagesController < ApplicationController
helper_method :page
def show
page ? render(:show) : not_found
end
private
def page
@page ||= Page.find_by(url: params[:page_url])
end
end
class AuthController < ActionController::Base
layout "devise"
end
52. doctype html
html
head
title
= content_for?(:title) ? yield(:title) : t('default_title')
= stylesheet_link_tag 'app/application'
meta name="theme-color" content="#ffffff"
== render 'layouts/ga/head'
body class="#{yield(:main_body_class)}"
= yield(:before_header)
== render 'layouts/app/flash'
== render 'layouts/app/header'
main
= yield
52
application.slim vs admin.slim
doctype html
html
head
title
= content_for?(:title) ? yield(:title) : t('default_admin_title')
= stylesheet_link_tag 'admin/application'
meta name="viewport" content="width=device-width,
initial-scale=1, shrink-to-fit=no"
body
.ui.sidebar.inverted.vertical.menu
== render 'layouts/admin/navigation'
.pusher
.ui.container#container
== render 'layouts/admin/header'
= yield
== render 'layouts/admin/footer'
54. ● Fat model and Skinny controller
● Business logic should always be in the
model
● The view should have minimal code
● Use helpers!
● Use models
● DRY (Don't Repeat Yourself)
54
BEST
PRACTICES