This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PostsControllers < ApplicationController | |
param_accessible [post: [:title, :content, category: [:name]], only: [:create] | |
param_protected :accepted, only: [:create, :update] | |
end |
Rozwiązanie jest na szczęście banalnie proste:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /app/controllers/application_controller.rb | |
class ApplicationController < ActionController::Base | |
include Controllers::WhitelistParams | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /lib/controllers/whitelist_params.rb | |
module Controllers | |
module WhitelistParams | |
extend ActiveSupport::Concern | |
included do | |
param_accessible [:controller, :action, :id, :utf8, :commit, :authenticity_token, :page] | |
end | |
end | |
end |
- :commit i :utf8 - formularze
- :page - will_paginate lub kaminari
- :authenticity_token - devise
Brak komentarzy:
Prześlij komentarz