rails g view_component NomeDoComponente
with stimulus:
rails g view_component NomeDoComponente –stimulus
File: - component.html.erb html for the component - component.rb ruby code for internal component logic - preview.rb preview for lookbook - /spec/component_spec.rb spec for component with rspec
import { Controller as BaseController } from "@hotwired/stimulus"; export default class Controller extends BaseController { connect() { console.log("Hello, Stimulus!", this.element); } }