{"id":19010298,"url":"https://github.com/railsware/smt_rails","last_synced_at":"2025-04-06T18:16:54.751Z","repository":{"id":2969965,"uuid":"3985037","full_name":"railsware/smt_rails","owner":"railsware","description":"Shared mustache templates for rails 3.","archived":false,"fork":false,"pushed_at":"2017-11-14T14:43:50.000Z","size":48,"stargazers_count":109,"open_issues_count":4,"forks_count":21,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-03-30T16:13:46.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://blog.railsware.com/2012/04/12/shared-mustache-templates-for-rails-3/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/railsware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-04-10T17:32:53.000Z","updated_at":"2024-07-31T17:32:01.000Z","dependencies_parsed_at":"2022-08-26T04:50:48.146Z","dependency_job_id":null,"html_url":"https://github.com/railsware/smt_rails","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fsmt_rails","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fsmt_rails/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fsmt_rails/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/railsware%2Fsmt_rails/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/railsware","download_url":"https://codeload.github.com/railsware/smt_rails/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247526768,"owners_count":20953143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-11-08T19:10:46.422Z","updated_at":"2025-04-06T18:16:54.730Z","avatar_url":"https://github.com/railsware.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SmtRails\n\nShared mustache templates for Rails 3 and 4 and Sprockets 2 and 3.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'smt_rails', :git =\u003e 'git://github.com/railsware/smt_rails.git'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install smt_rails\n\n## Usage\n\n    $ rails g smt_rails:install\n\nGenerator add into \"application.js\" requirements for mustache and \"templates\" folder in \"app\". Next you can create mustache templates in this folder or subfolders.\n\nFor example:\n\nFile: \"app/templates/tests/_test.mustache\"\n\n    Hello {{msg}}!!!\n\nIn view you can render this template by this way:\n\n    \u003c%= render \"tests/test\", :mustache =\u003e {msg: \"Test\"} %\u003e\n\nThe same template you can render in JavaScript:\n\n    var content = SMT['tests/test']({msg: \"Test\"});\n\n## Mustache Partials\n\nFile: \"app/templates/people/_list.mustache\"\n\n    {{#people}}{{\u003epeople/item}}{{/people}}\n\nFile: \"app/templates/people/_item.mustache\"\n\n    Name: {{name}}\u003cbr\u003e\n\nIn view you can render this template by this way:\n\n    \u003c%= render \"people/list\", :mustache =\u003e {people: [{name: 'Alex'}, {name: 'John'}]} %\u003e\n\nThe same template you can render in JavaScript:\n\n    var content = SMT['people/list']({people: [{name: 'Alex'}, {name: 'John'}]});\n\n## Configuration\n\n    SmtRails.configure do |config|\n      config.template_extension = 'mustache' # change extension of mustache templates\n      config.action_view_key    = 'mustache' # change name of key for rendering in ActionView mustache template\n      config.template_namespace = 'SMT'      # change templates namespace in javascript\n      config.template_base_path = Rails.root.join(\"app\", \"templates\") # templates dir\n    end\n\n## Demo\n\nSite: [http://st-rails-example.herokuapp.com/](http://st-rails-example.herokuapp.com/)\n\nSource code: [https://github.com/le0pard/st_rails_example](https://github.com/le0pard/st_rails_example)\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Fsmt_rails","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frailsware%2Fsmt_rails","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frailsware%2Fsmt_rails/lists"}