Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Ruby on Rails para Iniciantes - Aula 40
Search
Jackson Pires
May 19, 2015
Programming
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Ruby on Rails para Iniciantes - Aula 40
Criando pesquisas com o Ransack (Básico) 40
Jackson Pires
May 19, 2015
More Decks by Jackson Pires
See All by Jackson Pires
Como usar uma box Vagrant com a Cloud9 IDE para desenvolver com Elixir ou Phoenix?
jackson_pires
0
96
Conhecendo o módulo Forwardable do Ruby
jackson_pires
0
79
COMO INSPIRAR PESSOAS E MONETIZAR O SEU CONHECIMENTO?
jackson_pires
0
71
Conhecendo a gem guard, guard-rspec e guard-livereload
jackson_pires
0
91
GDG Meetup - Carreiras em T.I.
jackson_pires
0
100
20 minutos insanos de TDD e Ruby
jackson_pires
0
130
Ruby on Rails para Iniciantes - Aula 46
jackson_pires
0
180
Ruby on Rails para Iniciantes - Aula 47
jackson_pires
0
91
Ruby on Rails para Iniciantes - Aula 48
jackson_pires
0
380
Other Decks in Programming
See All in Programming
技術的負債の返済は、AI時代の複利で効く投資 — 経営としての意思決定とその遂行
curekoshimizu
0
1.9k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
340
個人開発基盤をまるごとCloudflareに引っ越して爆速で総合的体験を向上させた話
tinykitten
0
210
MVNOの申込からeSIM開通までをiOSアプリでつなぐ- 本人確認・MNP・通信事業者基盤をまたぐ実装
satotakeshi
0
490
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
440
Intent as Code
shoppingjaws
6
1.1k
KiroのSpecで「五目並べ」を作ってみる
satoshi256kbyte
1
250
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2.2k
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
160
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.5k
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
260
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
560
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
920
Chasing Engaging Ingredients in Design
codingconduct
0
340
Unsuck your backbone
ammeep
672
58k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
520
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Discover your Explorer Soul
emna__ayadi
2
1.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
950
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.3k
RailsConf 2023
tenderlove
30
1.6k
The Curse of the Amulet
leimatthew05
3
15k
Transcript
Ruby on Rails Para iniciantes - 3a Temporada \o/
http://videosdeti.com.br
[email protected]
Mentoring
Patrocinadores Roger Bernardi
Aula 40 Criando pesquisas com o Ransack (básico)
Ruby on Rails Index Customer Products Usuários Autenticados (normal_user, admin)
Addresses ControlUsers Usuários Autenticados (admin)
Ruby on Rails Products description quantity
Ruby on Rails Ransack
Ruby on Rails Adicione ao Gemfile... gem ‘ransack’
Ruby on Rails Rode o bundle install
Ruby on Rails Simple Mode
Ruby on Rails Helper search_form_for
Ruby on Rails Na View <%= search_form_for @q do |f|
%> <%= f.label :description_cont %> <%= f.search_field :description_cont %> <%= f.submit %> <% end %>
Ruby on Rails No Controller def index @q = Product.ransack(params[:q])
@products = @q.result end
Ruby on Rails Ordenando Colunas sort_link
Ruby on Rails Ordenando Colunas <%= sort_link(@q, :description) %>
Ruby on Rails Adicionando mais opções de pesquisa na view
Ruby on Rails Products description quantity
Ruby on Rails Adicionando mais opções de pesquisa na view
<%= f.label :quantity_lteq %> <%= f.search_field :quantity_lteq %>
Ruby on Rails Pesquisas não restritivas AND => OR def
index @q = Product.ransack(params[:q].try(:merge, m: 'or')) @products = @q.result end
Ruby on Rails Automatizando o E/OU Na view <%= f.select
:combinator, [[‘E’,’and’],[’OU’,’or’]], @q %> No controller @q = Product.ransack(params[:q].try(:merge, m: params[:combinator]))
Ruby on Rails Obrigado!