Padrino::ParamsProtection::ClassMethods

Module: Padrino::ParamsProtection::ClassMethods

Instance Method Summary

Instance Method Details

#params(*allowed_params) ⇒ Object

Implements filtering of url query params. Can prevent mass-assignment.

Examples:

post :update, :params => [:name, :email]
post :update, :params => [:name, :id => Integer]
post :update, :params => [:name => proc{ |v| v.reverse }]
post :update, :params => [:name, :parent => [:name, :position]]
post :update, :params => false
post :update, :params => true
params :name, :email, :password => prox{ |v| v.reverse }
post :update
App.controller :accounts, :params => [:name, :position] do
  post :create
  post :update, :with => [ :id ], :params => [:name, :position, :addition]
  get :show, :with => :id, :params => false
  get :search, :params => true
end
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部