techiferous / tabulous

Easy tabbed navigation for Rails
Other
322 stars 35 forks source link

Navbar not showing #48

Closed RickS1 closed 10 years ago

RickS1 commented 10 years ago

Good evening:

Lately I've been trying your gem to add an ellegant yet useful navbar to my project. The problem here is, every time I refresh the server (just for testing, in localhost), I don't achieve to make the navbar visible! Can you please help me figuring out what goes on? Just in case you wonder, I've followed the exact steps provided in the REFERENCE... I'm developing under Rails 3.2.1 and Ruby 2.1.2, and using gems like "bootstrap-sass", "devise" and "simple_form".

Thanks in advance!

techiferous commented 10 years ago

Would you mind sharing your app/tabs/tabulous.rb file to help troubleshoot? Also, if the navbar is not showing up, likely it's a problem with not specifying a controller in an active_when declaration.

RickS1 commented 10 years ago

Actually, it's an issue with the rendering, I guess. I can't manage to display subtabs while using bootstrap-type renderers. They only appear when I render by default or html5... Here is te code:

sesion_tab do
  text      'Iniciar sesión'
  link_path     '#'
  visible_when  {!current_user.present?}
  enabled_when  {!current_user.present?}
  active_when   {a_subtab_is_active}
end

user_subtab do
  text      'Como administrador'
  link_path     '/users/sign_in'
  visible_when  {!current_user.present?}
  enabled_when  {!current_user.present?}
  active_when   {in_action('any').of_controller('sesion')}
end

subuser_subtab do
  text      'Como cuenta asociada'
  link_path     '/subusers/sign_in'
  visible_when  {!current_user.present?}
  enabled_when  {!current_user.present?}
  active_when   {in_action('any').of_controller('regsub')}
end

Controllers and paths exist and, as I wrote earlier, subtabs only appear when rendered with :default or :html5, can you please help me?

techiferous commented 10 years ago

Perhaps you are trying to render the subtabs directly in the layout which is not supported for bootstrap renderers? See https://github.com/techiferous/tabulous/blob/master/REFERENCE.md#Helpers

RickS1 commented 10 years ago

I've solved the problem... Apparently, the place where the //=require bootstrap in the application.js appears has relevance at the time of parsing. Just changing it from place (after //= require jquery) made it work. My apologies for this being not a gem's issue, but I didn't find it anywhere.

Thanks for the support, anyway, and once again, my apologies :)

techiferous commented 10 years ago

@RickS1 No worries; glad you figured it out!

techiferous commented 10 years ago

Hi, did you figure this out? Do you still have this question?

On Jun 30, 2014, at 8:00 PM, RickS1 notifications@github.com wrote:

I have a doubt @techiferous, is there a way to make a tab active in action of more than one controller? I've tried that but it seems the tabs automatically dissappear when clicking that specific tab. Once again, my apologies for being so annoying, but I'm quite newbie to Ruby and Rails.

— Reply to this email directly or view it on GitHub.