Reputation: 3095
I have use tabs_on_rails plugin to do tabs view. and its documentation told me that we can custom a builder to override methods like
the problem is I don't know where to put the override code? Does anyone can help me?
Upvotes: 2
Views: 843
Reputation: 46
Do place custom builder class file in /config/initializers directory within your application and restart your server.
Upvotes: 0
Reputation: 346
@Topley is right but not enough.
You should put the particular class input /lib and name it as menu_tab_builder.rb
Then you will find that it still doesn't work because of Rails3.
In addition, you need to add open_tabs
and close_tabs
function.
# the following is necessary to make this rails3 compatible def open_tabs(options = {}) @context.tag("ul", options, open = true) end
# the following is necessary to make this rails3 compatible def close_tabs(options = {}) "".html_safe end
Good luck!
Upvotes: 1
Reputation: 115372
If you put the custom builder class in a file within your Rails application's /lib
directory then it will be automatically loaded by Rails.
Upvotes: 0