Skip to main content

Posts

Showing posts from November, 2014

Implement Modal in rails

Sometimes we need to show a modal window that comes flying on the website which really feels good as we do not have to load a new page.The reason why i love using modals is that you can show two things at the same time. For example :-Suppose user registers and logs in to your website,then immediately after a matter of seconds,you can show a modal to show/edit his profile OR add some more info about himself or similar stuff and all the user can do is just click button to continue/reject without changing the previous screen.Trust me...it feels good.see the example1 , example2    Similarly if You talk in context of Rails,If the user is in index page,you can render the show action in the Modal,Wowwww...so user can either see the stuff he clicked on index page or cancel the modal,thereby reducing your effort to reload or write extra code for index->show and again show->index. Enough of lectures...lets start the main stuff To add MODAL to your application just follow two steps