-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config #29
Config #29
Conversation
spec/helpers/navbar_helper_spec.rb
Outdated
expect(fragment).to have_css "#{left_items_css} a[href='#{path}']", text: name | ||
expect(fragment).to have_css "#{right_items_css} a[href='#{path}']", text: name | ||
end | ||
path = Rails.application.routes.url_helpers.users_path |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use let
and move fragment
and path
from it
let(:fragment) { view.tramway_navbar }
let(:path) { Rails.application.routes.url_helpers.users_path }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Thanks!
lib/tramway/configs/entity.rb
Outdated
end | ||
|
||
def routes | ||
OpenStruct.new index: Rails.application.routes.url_helpers.public_send("#{name.pluralize}_path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will not work with namespaced entities like "gpt/interaction"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed! Thanks!
What's changed basically?
What's changed for tramway drivers?
Tramway Configuration DSL and Tramway entities
config/initializers/tramway.rb
Rendering entities in a navigation bar
By default, entities will be rendered in a Navigation bar on the left.
Find more info here