-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
view variants support #2578
Comments
I'm not familiar with view variants. Is this a Rails feature we're not supporting? If so, could you link to the docs so we can plan out how to support it? |
https://guides.rubyonrails.org/layouts_and_rendering.html#the-variants-option |
@Thrizian @hksk touch app/views/admin/courses/show.html+student.erb module Admin
class CoursesController < Admin::ApplicationController
before_action :with_variant, only: %i[show]
private def with_variant
if SOME_CONDITION
request.variant = :student
end
end |
Oh! I see, it's those! @goosys, when you were looking into this, did you see a way which would make this easier to do? (Like an API administrate could support?) |
Hm, that all said, I think solving this with documentation is fairly reasonable too, if we had a section in the Guides, for example! |
add a view variant, example:
currently in the main controller, cant pass a variant, seems variant: :value not works
so I implemented something like this in my generated controller
I guess we can add some like
The text was updated successfully, but these errors were encountered: