techiferous / tabulous

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

Shall we create dynamic tabs through view. #56

Closed shivareddy547 closed 8 years ago

shivareddy547 commented 8 years ago

Hi,

Shall we create dynamic menus like Tabs (Management) creation,Footer links management using tabulous gem.

As per my requirement i need to manage tabs through admin configuration.

Thanks in advance.

Thanks Shiva.A

techiferous commented 8 years ago

Hi @shivareddy547,

No, I would not recommend tabulous for dynamic menus or footer links. It is designed primarily for basic server-rendered tabs, nothing too complex.

shivareddy547 commented 8 years ago

Thanks for reply, Yeah i tried but no success i almost done.

Tabulous.setup do tabs do Tab.all.each_with_index do |eachtab,index| "menu#{each_tab}_tab" do text { "#{each_tab.split('Controller').first}" } link_path { profile_index_path } visible_when { true } enabled_when { true } active_when { in_action('any').of_controller('profile') } end

end

As above I created Tab Model and storing controller name and actions names which configuration will done by admin.

In fronted i created helper method and try to change tabs dynamically based on controller name(each_tab) But it's not accepting.

"menu_#{each_tab}_tab" do

end For Exmaple: each_tab = "products"

Every time "menu_#{each_tab}_tab" it's accepting constant not as string i trying to convert with available methods(singularize, safe_constantize) but no result.

Any suggestions..?

Thanks in Advance.

Thanks Shiva.A

techiferous commented 8 years ago

Try using send as this person does: https://github.com/techiferous/tabulous/issues/44

shivareddy547 commented 8 years ago

Great thanks.

Thanks Shiva.A