PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, May 18, 2022

[FIXED] How to render a partial on button-click in rails using javascript and not by using a method in controller?

 May 18, 2022     javascript, partial, ruby-on-rails     No comments   

Issue

I have a issue where I need to render a partial on a button click say do u really want to perfrom the action and it has to be done by using only javascript, adding a method in the controller and thereby rendering the partial is not preferable.


Solution

Simply load the partial and just hide it with CSS using display:none and when the users clicks on the button show him the confirm dialog and change the CSS of the partial from none to block and you are done



Answered By - Shreyas Agarwal
Answer Checked By - Terry (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing