Comments (5)
I had this problem also. I used ':remote => true' in the form tag instead. My form returns a JSON response and prints flash messages based on that response. Let me know if you need to see an example.
from jquery-modal-rails.
I'd like to see it.
from jquery-modal-rails.
app/views/spree/shared/_login.html.erb
<%= form_for Spree::User.new, :as => :spree_user, :url => spree.create_new_session_path, :format => :json, :remote => true do |f| %>
<div id="password-credentials">
<p>
<%= f.label :email, Spree.t(:email) %><br />
<%= f.email_field :email, :class => 'title', :tabindex => 1 %>
</p>
<p>
<%= f.label :password, Spree.t(:password) %><br />
<%= f.password_field :password, :class => 'title', :tabindex => 2 %>
</p>
</div>
<p>
<label>
<%= f.check_box :remember_me %>
<%= f.label :remember_me, Spree.t(:remember_me) %>
</label>
</p>
<p><%= f.submit Spree.t(:login), :class => 'button primary', :tabindex => 3 %></p>
<% end %>
and respond to javascript in your controller.
from jquery-modal-rails.
I also have this same issue - I would like to see a full working example if anyone has one available
from jquery-modal-rails.
I found that having remote:true in the link_to_modal actually prevented the behaviour I would have expected. When I removed this, it seems that supplying a url (rather than a div) is sufficient to have the modal content load on ajax behaviour that I was looking for.
My link is now:
<%= link_to_modal 'Contact Us', feedbacks_contact_path, :class=>"contact-link" %>
and the controller at the feedbacks_contact_path renders the contents of the modal window. Adding ':remote => true' to the form allows the submission to be ajax. I also realised there is a demo app included in the gem, and it some some working examples (but some which are no longer working also).
from jquery-modal-rails.
Related Issues (16)
- Close button not completely visible. HOT 7
- Goggle maps showing strange.
- Modal reload after user registration failure HOT 1
- Rails 4, modal not showing HOT 7
- Width / Height parameters don't change window size HOT 2
- close button not visible HOT 2
- Why is jquery-ui required?
- Demoapp must be removed from gem
- js functionality after modal renders HOT 3
- Interested in taking over project HOT 9
- Please support url link for image and support iframe.
- support for rails 5 HOT 1
- Jquery datepicker not appearing in modal HOT 1
- Modal linking to another modal doesn't close the first modal HOT 1
- undefined method `link_to_modal' in production and staging environment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-modal-rails.