{"id":28509120,"url":"https://github.com/atomicobject/jquery_expand_assets","last_synced_at":"2025-07-02T23:32:02.913Z","repository":{"id":4405380,"uuid":"5542717","full_name":"atomicobject/jquery_expand_assets","owner":"atomicobject","description":"A Sprockets processor and Rails engine for jquery.expand assets.","archived":false,"fork":false,"pushed_at":"2013-04-17T19:45:46.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":25,"default_branch":"master","last_synced_at":"2025-06-08T22:08:04.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":false,"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/atomicobject.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-08-24T16:14:03.000Z","updated_at":"2014-05-18T04:56:22.000Z","dependencies_parsed_at":"2022-06-25T20:19:47.753Z","dependency_job_id":null,"html_url":"https://github.com/atomicobject/jquery_expand_assets","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/atomicobject/jquery_expand_assets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fjquery_expand_assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fjquery_expand_assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fjquery_expand_assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fjquery_expand_assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomicobject","download_url":"https://codeload.github.com/atomicobject/jquery_expand_assets/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomicobject%2Fjquery_expand_assets/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263232748,"owners_count":23434728,"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":"2025-06-08T22:07:29.105Z","updated_at":"2025-07-02T23:32:02.891Z","avatar_url":"https://github.com/atomicobject.png","language":"Ruby","readme":"# jquery.expand assets [![Build Status](https://secure.travis-ci.org/atomicobject/jquery_expand_assets.png)](http://travis-ci.org/atomicobject/jquery_expand_assets) [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/atomicobject/jquery_expand_assets)\n\nA Sprockets processor that wraps html in a jquery.expand function. It is specifically meant to work within the Rails asset pipeline.\n\nThe processor outputs CoffeeScript, so you'll need to have the result be processed by the CoffeeScript processor.\n\n## Requirements\n\nThis gem is syntax compatible with Ruby 1.9. It does not run on older Rubies.\n\n## Creating and using templates\n\nCreate your templates in a directory named `app/assets/javascripts/templates`. Organize your templates within subdirectories. I personally organize them based on what resource they're associated with.\n\nWrite your template and wrap it in a root element.\n\nExample: `app/assets/javascripts/templates/articles/_entry.js.coffee.expand`\n\n    \u003cdiv\u003e\n      \u003ch2 class='name'\u003e\u003c/h2\u003e\n      \u003cp class='content'\u003e\u003c/p\u003e\n    \u003c/div\u003e\n\nYour template is now available to Javascript as a function on the `JST` object. Pass an expand directive to the function and you'll be given the result minus the wrapper element.\n\nExample: see `articles/_entry.js.coffee.expand` above\n\n    directive = { name: 'Joe', content: 'I love Smurfs.' }\n    html = JST['articles/entry'](directive)\n    $('body').append(html)\n\nIn this example, the result html will be:\n\n    \u003ch2 class='name'\u003eJoe\u003ch2\u003e\n    \u003cp class='content'\u003eI love Smurfs.\u003c/p\u003e\n\n## Naming conventions\n\nTemplates are named on the `JST` object based on their filename. Directories under `app/assets/javascripts/templates` are preserved. If the template's filename starts with an underscore, then the underscore is removed from the name.\n\nExamples:\n\n`articles/_entry.js.coffee.expand` becomes `articles/entry`  \n`articles/comments/_comment.js.coffee.expand` becomes `articles/comments/comment`  \n`articles/response.js.coffee.expand` becomes `articles/response`  \n\n## Resources\n\n* [jquery.expand](https://github.com/atomicobject/jquery.expand)\n* [jquery.expand examples](http://spin.atomicobject.com/2011/07/10/jquery-expand-examples/)\n\n## Development\n\nThis project depends on bundler for installing and using development gems. You'll need to `bundle install` and `bundle exec rake` to run the tests.\n\n## Thanks so much!\n\nI'd like to give a huge 'thank you' to the [Sprockets](https://github.com/sstephenson/sprockets), [haml_assets](https://github.com/infbio/haml_assets), and [haml_coffee_assets](https://github.com/netzpirat/haml_coffee_assets) projects. Without their examples, I'm not sure I would have figured out the code required to create the Rails engine and Tilt template.\n\nAuthors\n=======\n* Matt Fletcher (fletcher@atomicobject.com)\n* © 2013 [Atomic Object](http://www.atomicobject.com/)\n* More Atomic Object [open source](http://www.atomicobject.com/pages/Software+Commons) projects\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fjquery_expand_assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomicobject%2Fjquery_expand_assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomicobject%2Fjquery_expand_assets/lists"}