Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto Ember.view creation to Templates? #50

Closed
btelles opened this issue May 4, 2012 · 5 comments
Closed

Add auto Ember.view creation to Templates? #50

btelles opened this issue May 4, 2012 · 5 comments

Comments

@btelles
Copy link
Contributor

btelles commented May 4, 2012

Proposed new feature:

As a developer, I don't want to create a template, then separately define a view that uses that template.

Acceptance criteria:

The handlebars (.hb, .hjs) file handler should (in addition to creating a valid Ember template), also create a corresponding Ember view.

For example, the file "app/assets/javascript/ember/templates/post_list.hb" should create a template AND a view for the application. The view might be specified as the following:

<script type="text/javascript">

Ember.TEMPLATES[...]...

App.PostListView = Ember.View.extend({
  templateName: "ember/templates/post_list"
}); 
</script>

Any thoughts?

If I get a few +1's I'll be happy to start implementing.

@patr1ck
Copy link
Contributor

patr1ck commented May 4, 2012

Should this be on Ember.js instead of ember-rails?

@tomdale
Copy link
Member

tomdale commented May 5, 2012

I think you're assuming a one-to-one view-to-template relationship that doesn't always exist.

Maybe we could have a generator that generates both? I would rather be explicit about view class definition than have one created implicitly for each template generated.

@tchak
Copy link
Member

tchak commented May 5, 2012

+1 for @tomdale

I am definitely against a one-to-one view-to-template relationship. If you vant a generator for this, do it.

@tchak
Copy link
Member

tchak commented May 5, 2012

Seems like our generator already generate template and view.
See @patr1ck response in #48

Closing. Reopen if more questions

@tchak tchak closed this as completed May 5, 2012
@btelles
Copy link
Contributor Author

btelles commented May 6, 2012

Ok, thanks guys.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants