{"id":16630848,"url":"https://github.com/ravicious/rails-elm-forms","last_synced_at":"2026-07-01T17:31:41.513Z","repository":{"id":66976510,"uuid":"73019020","full_name":"ravicious/rails-elm-forms","owner":"ravicious","description":"Explores ways in which an Elm app can be integrated with an existing Rails application for writing dynamic JS forms","archived":false,"fork":false,"pushed_at":"2016-11-21T20:52:09.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-15T00:27:36.089Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ravicious.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-06T21:07:26.000Z","updated_at":"2019-04-25T14:58:04.000Z","dependencies_parsed_at":"2023-05-30T04:30:32.213Z","dependency_job_id":null,"html_url":"https://github.com/ravicious/rails-elm-forms","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ravicious/rails-elm-forms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravicious%2Frails-elm-forms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravicious%2Frails-elm-forms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravicious%2Frails-elm-forms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravicious%2Frails-elm-forms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ravicious","download_url":"https://codeload.github.com/ravicious/rails-elm-forms/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ravicious%2Frails-elm-forms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35017089,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T04:49:34.590Z","updated_at":"2026-07-01T17:31:41.486Z","avatar_url":"https://github.com/ravicious.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rails-elm-forms\n\nThis project explores ways in which an Elm app can be integrated with an existing Rails application.\n\n# Conventions\n\n## Any Elm main module should live in `app/assets/javascripts/elm` along with a JS script which handles the Elm app setup\n\nBy \"main module\" we mean an Elm module which exports a `main` function which calls a variant of\n`Html.program`. If you have an `OrderForm.elm` file, there should be a file called `order_form.js`\nbeside it. `order_form.js` should require the Elm file and embed the Elm app:\n\n```javascript\nvar Elm = require('./OrderForm.elm')\n\nvar node = document.getElementById('order_form')\nvar app = Elm.OrderForm.embed(node)\n```\n\n`order_form.js` is then compiled by webpack and required by the Rails app. This is because we leave\nall the Elm compilation steps to webpack and Sprockets have to handle only a clean JS file.\n\n## Any app-related modules should be nested under the main module namespace\n\nIf you have a main module `Foo` and another module `Bar` with `Foo`-specific functions, the `Bar`\nmodule should be called `Foo.Bar`. This helps with properly namespacing the apps since they all\nlive in the same folder.\n\n## Files compiled by `webpack` should have `.webpack.js` extension\n\nIt's easier to ignore all `*.webpack.js` files in .gitignore than add a new .gitignore statement\nfor each new webpack entry point. Such files are build artifacts and we don't want to keep them\nin the repo.\n\n## Passing data from the server to the Elm app is done through HTML `data` attributes\n\nFirst the server puts the data into the view through the `data` attribute of the node in which\nthe Elm app is embedded in. Then the JS file reads the `data` tag – usually by using `jQuery.data`,\nsince it automatically parses the JSON string in the `data` attribute to a JS object.\n\nThen the JS file passes the JS object as flags to the Elm app and that's it.\n\n# Compiling the Elm app\n\nYou can compile all Elm apps by issuing the following command:\n\n```\nnpm run webpack-dev-build\n```\n\n`npm run webpack-watch` recompiles an app on each change to its source files (including Elm files\nthanks to [elm-webpack-loader](https://github.com/rtfeldman/elm-webpack-loader)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravicious%2Frails-elm-forms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fravicious%2Frails-elm-forms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fravicious%2Frails-elm-forms/lists"}