Rails partial path when bootstrap tab active - ruby-on-rails

I am building a profile page that contains a navigation tab with 3 tabs(account, settings, and language&display). Each tab renders a partial. What I want to achieve is that for each partial rendered the URL will change as well.
For example when Settings tab is active I want to be on settings_path, and the url: localhost:3000/settings.
my page here
I did not find anything about partials and paths, do you have any idea about this?

Related

Link to jQuery UI tab from external page and set tab to active

I have a site using jQuery UI tabs and link to a specific tab from external pages using something like
<a href="/tabspage#tab-3">
and this correctly opens the proper panel, but it does not give the actual tab the proper classes like ui-tabs-active or ui-state-active.
I have tried some custom scripting to find the index of the active panel and then go find the corresponding tab and add the classes to it, but then clicking on another tab does not remove those classes from the initial active class.
Is it possible to link to a specific jQuery UI tab and also make the tab of the opened panel highlighted?

Templating a secondary menu with linking pages

I'm using ASP.NET MVC with Razor C# and I have implemented a main menu appearing on every page through _Layout.cshtml.
One of the pages linked to this menu opens a page that includes a secondary menu.
This page with the secondary menu links to several different pages which are navigated via the same secondary menu.
I've used Partial views to hold each secondary menu page, and I'm wondering what is the easiest/preferred way to output these partial pages via the page with the secondary menu? (Or perhaps I shouldn't even be using Partial views to save having to add the secondary menu to each page).
Thanks.
Ok, A friend, who is also working on the same problem, just showed me this: https://www.youtube.com/watch?v=SrlU8sr5Tqc
So the answer seems to be Nested Layouts.

gmaps4rails in partial twitter bootstrap modal

I'm building a site where there is only one page and then a modal display. The modal shows various pages and has the core functionality of the app. Each page in the modal is rendered via ajax so I have two problems I'm encountering
I need to render a map in a partial on the modal. I've searched all over and no answer has solved the problem since the modal div itself exists from page load, but the partial does not.
Any thoughts?
The partial is loaded with ajax so the js dependencies included are not loaded.
You should add these manually in your source page.
To know which one are needed, display your modal and look at the html source.

multiple google plus buttons (one in rails view, one in a partial that the rails view has a link to)

I'm using the G+ button on a page. This is all great, but when I load a modal box that has a partial page on top of this page, the G+ button on the modal box does not show up.
Pretty sure this is because the G+ on the modal box is using the same id as the page (___plusone_0). Normally this # increments (__plusone_1, ___plusone_2, etc) but for some reason the one in the partial doesn't know about the other buttons. How can I fix this?

How to build a tabbed Edit View for a big ViewModel in ASP.NET without JavaScript?

I've got a big ViewModel for a ContactViewModel with several addresses (default, invoice, delivery). This ContactViewModel I would like to edit within a DefaultAddress tab, etc. and I would like to know how to handle this without JavaScript? Is this possible?
Tell me if I'm off base here;
The way i think i'd approach this is to create a partial view which takes a list. the partial view would itterate through the list and create another partial view which is the tab.
on click of the tab i'd do a postback and store the clicked tab. this id then becomes the active tab.
when i come back to rebuild my page, the partialview for the actual tab would need to check to see if it's active and then make itself visible. if not visible then simply render nothing maybe.
This can be done with CSS. Here is an example: http://www.alistapart.com/articles/slidingdoors/
The selected tab/view will need to be rendered on the server. I can see each tab being a link, when the link is clicked the correct view and selected tab is returned.
Some of the css tabs don't work correctly in IE6. I'm not sure if the above link is one of them.

Resources