twitter bootstrap modal does not work in rails3 layout? - jquery-ui

I have a twitter bootstrap modal dialog. I used the example here:
http://twitter.github.com/bootstrap/javascript.html#modals
and this works well by its self. Works well if I add this to a rails view like index.html.erb of one of my views. Though if I add the same stuff that works to my layout (specifically my navigation one) so that this modal can come down on ANY view in the app, while it works, it never "fades in" it is always behind a darkened screen. I am pulling my hair out trying to figure out why this is. I can literally take the modal div, slap it into the view and it works fine, if its in that layout though. No dice. I am not sure what I am missing or if this is just a bug in twitter boot strap modals or what? Anyone else have this issue? Am I missing something to add to the class of the modal?

Related

Modal window don't work times to times in any browser

I create application on ruby on rails and add modal window for login. I put modal code in partial layouts/header. I expect it must work on every page of my app but not. Modal don't open in home/index. It's start work on home/about. I don't understand why. I'll update my ask If needs code. Can anyone help me understand?
I try to move modal code on another pages but get same effect.
home/index and home/about is URI?
Make sure you use the same layout (header file) and the modal element exist in HTML of home/index (you can use dev tool - f12 for checking)
Please, Does the modal need to be triggered by a button or something?

Templates and sub Templates aren't working in Nav

So, I've got this app I'm working on. I've got a nav built and it sort of works. But not right. I'm pretty confident I'm screwing this up some where.
The nav looks like this. The problem is, that it never shows the current view highlighted in the nav (except for dashboard) unless i go directly to that page. But, if I do go directly to the page, none of the angular stuff works? The second problem is, under the Admin menu, I can't get any views to appear. But, if I refresh the page, then I can? That seems odd.
This is what my routes look like. What am I missing?
UPDATE:
Ok, so, if I start from dashboard, then navigate to other pages (such as admin/create or admin/manage) then it doesn't work (except for /properties) and I don't see the view update correctly (again, except for /properties). However, if I start in /properties, refresh the page, I see the content (minus any of the angular stuff), but I can navigate to admin/create and admin/manage. Again, Angular doesn't work, but I can at least navigate and see the rails partials.
UPDATE 2:
So, I figured out my own first mistake. I needed to add the routes into the angular side as well as the rails side. Now, I just need to figure out why highlighting isn't working?
Move the partials to it's own foler:
example: app/views/shared/_partial_name.html.erb
right now, you have the partials under the layout folder. And my guess is that is causing the rendering problem.
Keep application.html.erb as the only file under the layouts
then render the partials as shared/partial_name

Render 2 views at the same time?

I'm kinda new to rails so forgive if this is a stupid question.
The scenario is:
I got my events controller with a index view that shows all events on the page. Now, what i want to achieve is: User clicks on one of the events, lightbox comes up showing all info about about that one event, with all the other events still behind the dark background of the lightbox. User closes the light box and process repeats. Pinterest is a good example of what i'm trying to do.
At the moment, i got these 2 views working properly. User clicks on the event and is taken to the show action.
So i'm wondering if what i'm trying to do is RESTfully achievable(without too much hacking around) in rails(3.2.8) and if so, would appreciate some insight as to where i should start from.
Thanks a lot.
As far as I understand what you want to achieve, it has nothing to do with actually rendering 2 views at the same time. What you're describing is simply making an ajax call with lightbox that opens up an URL that renders another view in the shown DIV or IFRAME (whatever lightbox uses)...
Depending on which version of Rails you use the implementation of this looks a bit different. But actually what you have to do is simply include LightBox2 in your Rails app, by simply adding the appropriate JS and CSS files and then supply the necessary class at your link_to calls...
Hope it's clear what I mean.
UPDATE
See this link for further info.

jquery mobile splitview plugin, transition from a non-split page to a split page

I´m using jquery mobile for an iPad app, and I wanted to have the typical splitview layout so I used the splitview plugin which is working fine until now, but I would still have some minor questions:
Can my first page be a normal page, meaning non-split and then when for example I click on a button go to the second page which would be split?
How do I do to enlarge the left panel if I find it a bit narrow?
Thank you for your help.
I am having the same issue.
I am able to workaround this by providing rel="external" on the link in my navigation menu. This however reloads the entire page, and the ajax effect is gone.
<li>Some Text</li>
I will be spending some time on it this weekend to get it working through ajax, will let you know if I find a solution.

jQueryMobile page transition functionality broken

I am building a cross-platform app using jQueryMobile and Phonegap. Currently using jQM 1.1.0 and Phonegap 1.6.1.
The page transition function sometimes just seems to break down when the user clicks a button or list item that links to another page in the app.
<a href="#page2">
This kind of link is what the whole app is made of. But depending on god knows what, sometimes when you click a link the app stalls. External links will still be followed, and buttons that don't trigger any page changing work fine. But anything with href and $.mobile.changePage seems to be broken.
This problem occurs in iPad Simulator and iPhone Simulator, not in Chrome. It seems to have something to do with the type of page transition specified (i.e. fade or slide or flip etc). Some transitions seem to cause problems, sometimes it seems to be the lack of a specified transition that is the cause, and sometimes neither of those explanations have any traction.
Before I add a whole bunch of code, I'm interested if anyone has similar experiences.

Resources