Skip to content

Best practices for javascript #168

@leonard-henriquez

Description

@leonard-henriquez

Is it possible to have javascript as a sidecar file (like this)?

- /app
  - /components
    - /button
      - button.css
      - button.html.erb
      - button.js
      - button.rb

If that's not possible what is the best practice to handle javascript? Should it be mentioned in the readme?

Is it planned to develop a feature to pass ruby variables from components to javascript (as it's done by the gon gem)?

PS: Please be gentle, it's my first issue 🐣
@joelhawksley Thank you so much for this gem! I have been waiting for this for years. I am so glad it's been merged in Rails. 🎉

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions