existentialmutt / ajax_modal_rails Goto Github PK
View Code? Open in Web Editor NEWajax-driven modals for rails apps using bootstrap 4
License: MIT License
ajax-driven modals for rails apps using bootstrap 4
License: MIT License
You should provide a note about the layout magic and maybe some sugar to customize it, so if you have a controller that uses layout
for non-ajax stuff it falls back to this rather than nil
. I just put this at the top of one controller:
module Foo
class Bar < Baz
include OneThing
include AjaxModalRails::Controller
layout ->(_) { ajax_modal_request? ? ajax_modal_layout : 'what_is_otherwise_expected' }
It took a little poking about in the source code for me to see that this is what I needed to do. Maybe you could provide non_ajax_layout
or something, so this would have been
module Foo
class Bar < Baz
include OneThing
include AjaxModalRails::Controller
non_ajax_layout 'what_is_otherwise_expected'
We could do the modal stuff w/ our own HTML/CSS
I'm thinking people will expect to be able to close the modal by clicking on the grey mask layer or by pressing escape.
This will allow the modal window to close w/our redirecting the underlying page
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.