Skip to content

Migrate the steps components to align with Phlex conversions #166

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

Merged

Conversation

karinevieira
Copy link
Contributor

Phlex 2.0 follows a specific folder structure and naming convention for views and components.

For views, they should be placed in the app/views directory under the Views namespace, and must inherit from Views::Base.

# frozen_string_literal: true

class Views::Articles::Index < Views::Base
  def view_template
    h1 { "Articles" }
  end
end

For components, they should be placed in the app/components directory under the Components namespace, and must inherit from Components::Base.

class Components::Button < Components::Base
  def view_template
    button { "Click me" }
  end
end

This pull request continues the migration of the components that are currently in the app/views/components folder to app/components, in accordance with the Phlex conventions.

@stephannv stephannv merged commit 6e173d0 into ruby-ui:main Feb 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants