markets / sudo_rails Goto Github PK
View Code? Open in Web Editor NEW๐ Sudo mode for your Rails controllers
Home Page: https://rubygems.org/gems/sudo_rails
License: MIT License
๐ Sudo mode for your Rails controllers
Home Page: https://rubygems.org/gems/sudo_rails
License: MIT License
Inspiration:
Since now Rails has 2 assets pipelines, Sprockets and Webpacker, would be nice to remove the Sprockets dependency. I'd take the same approach we took in Maily: markets/maily#48.
We already inject some styles, for customization, via: https://github.com/markets/sudo_rails/blob/master/app/views/sudo_rails/_inject_custom_styles.html.erb. So, it would be as easy as moving all default styles there.
NOTES
custom_logo
option independent from Sprockets (maybe absolute URL is just fine?)Line 16 in d7ce8e9
Hi @markets,
Thanks for the gem! I'm trying to use it in my Rails app and it looks like it's not working. Let's say I would like to protect devise user edit method. In registrations_controller.rb
class Users::RegistrationsController < Devise::RegistrationsController
sudo only: [:edit]
end
as soon as I go to edit page it prompts sudo page with password ๐๐ป. When I enter the password I just get redirected back to the same sudo page I can't reach edit page. That is one thing.
Another thing (or maybe it's not possible) is to protect :update
method of a controller so when I click on a submit button to get the sudo page and after entering password to get form submitted.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.