Coder Social home page Coder Social logo

ember_data_example's People

Contributors

aew avatar bcardarella avatar cyril-sf avatar dgeb avatar intuitivepixel avatar lulezi avatar pangratz avatar richardiux avatar sly7-7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ember_data_example's Issues

Update object only when form is submitted

Two possible approaches:

  • edit a copy of the contact and apply changes when the form is submitted
  • save the original version of the object and then revert to it on cancel

Rather than doing something custom, I'd like to figure out if ember-data will provide a model state concept for handling this.

collectionUrl, resourceUrl are ignored -> use namespace instead

Many thx for the example, that really got me going -

Alas, I tried it with the current version of ember-data(emberjs/data@bd9998f) and ran into some issues: It looks like the properties

  collectionUrl: '/contacts',
  resourceUrl: '/contacts/%@',
  resourceName: 'contact'

on the Contact-Model are not supported by the curent rest-adapter. As far as I have seen, they are ignored completely - however the RestAdapter has gotten a builUrl-function that supports namespaces and suffixes. So, in order to get models running with a different resourceUrl, I had to set up the RestAdapter like this:

 store = DS.Store.create
                revision: 3,
                adapter: DS.RESTAdapter.create({ bulkCommit: false, namespace: "admin" })

which now mounts the contacts into "/admin/contacts". As far as I could see, the RestAdapter does currently not support a configuration per model(correct me, If I'm wrong...). So, if somebody needs models from another namespace, this is the place to look into...

Cheers
Stefan

tutorial?

is there a tutorial that walks through how this app was created?

is there more clean way to implement transitionAfterSave?

in ember_data_example github source code. It use this approach

 transitionAfterSave: function() {
     // when creating new records, it's necessary to wait for the record to be assigned
     // an id before we can transition to its route (which depends on its id)
     if (this.get('content.id')) {
       this.transitionToRoute('contact', this.get('content'));
     }
 }.observes('content.id'),

It works fine, but maybe, this function will be executed whenever model's ID property is changed. I'm finding some more semantic way.

I want transition to be executed when the model's status is changed to 'isDirty' = false && 'isNew' == true form 'isDirty' = true, 'isNew' = false.

How can I implement this?

contentBinding is Superfluous

First, thanks for this very helpful project.

It seems that in contacts.hbs, explicitly setting the contentBinding is unnecessary:

{{view App.ContactInListView contentBinding="contact"}}

Works just as well using:

{{view App.ContactInListView}}

Can't work out how or why this is so though. Must be magic.

workflow bug

1 click "add new contact" , then edit interface shows

2 then click "all contact" at left side , then a bug shows

restAdapter needs error handling

This was intentionally left out initially, as it's unclear how errors should flow from the adapter, and back through the store and model in ember-data.js.

Validations have been added to the Contact model in Rails. If either the first or last name is left blank, a record will not be saved properly. This needs to be conveyed to the user.

Update spec_helper and acceptance test examples

Updating the example specs to accommodate for both unit and acceptance tests, and having test_helper use App.reset() instead of deferring and advancing app readiness would be awesome. I've got a good weekend to do this if I can help.

Add tests for Ember application

I think it would be neat if this wonderful sample repository would illustrate how to test the Ember application. I'm not very experienced with Rails so I don't know exactly where to put JS tests.

I just wanted to open this issue to start a discussion. Any ideas?

linecache and ruby-debug-base gem versions are too recent

Could not find linecache19-0.5.13 in any of the sources
Could not find ruby-debug-base19-0.11.26 in any of the sources

Changing the Gemfile.lock to use linecache19-0.5.12 and ruby-debug-base19-0.11.25 let me bundle correctly.

issues with including/not including root in json

If you include the root 'contact' in your json, then the initial load goes all 'null null' for me. If you don't however the ember-data bit that does the json[root] lookup is incorrect and didCreateRecord seems to throw an error. Trying to work through this now, but wanted to document in case I'm doing it wrong or it's a known bug.

Upgraded to ember-rails (0.7.0), stopped working.

I removed app/assets/javascripts/vendor and made the following change to app/assets/javascripts/application.js:

-//= require ./vendor/ember
-//= require ./vendor/ember-data
+//= require handlebars
+//= require ember
+//= require ember-data

Refreshing listing causes error

When loading data directly with App.store.loadMany(), subsequent calls to App.store.findAll() result in the exception Uncaught Error: <DS.StateManager:ember368> could not respond to event setData in state rootState.loaded.

rails runtime error

hi, I'm getting this error after running the "rails s" and visiting the page at localhost:3000.
But since I'm not a rails expert I'm not sure if this is a bug a rails related problem...

here is my console output:

alex@leda ~/workspace/ember_data_example »   rails s
=> Booting WEBrick
=> Rails 3.2.9 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
        SECURITY WARNING: No secret option provided to Rack::Session::Cookie.
        This poses a security threat. It is strongly recommended that you
        provide a secret to prevent exploits that may be possible from crafted
        cookies. This will not be supported in future versions of Rack, and
        future versions will even invalidate your existing user cookies.

        Called from: /usr/local/Cellar/ruby/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/session/abstract_store.rb:28:in `initialize'.

[2013-03-11 20:35:28] INFO  WEBrick 1.3.1
[2013-03-11 20:35:28] INFO  ruby 1.9.3 (2013-02-22) [x86_64-darwin12.2.1]
[2013-03-11 20:35:28] INFO  WEBrick::HTTPServer#start: pid=62314 port=3000


Started GET "/" for 127.0.0.1 at 2013-03-11 20:35:45 +0100
Connecting to database specified by database.yml
Processing by ApplicationController#index as HTML
  Rendered application/index.html.erb within layouts/application (3.4ms)
Completed 500 Internal Server Error in 143ms

ActionView::Template::Error (
  (in /Users/alex/workspace/ember_data_example/app/assets/javascripts/templates/_contact_edit_fields.hbs)):
    3: 
    4:   <title>EmberDataExample</title>
    5:   <%= stylesheet_link_tag    "application" %>
    6:   <%= javascript_include_tag "application" %>
    7:   <%= csrf_meta_tags %>
    8: 
    9: 
  app/views/layouts/application.html.erb:6:in `_app_views_layouts_application_html_erb___1363792714881371063_70207568502280'


  Rendered /usr/local/Cellar/ruby/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
  Rendered /usr/local/Cellar/ruby/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
  Rendered /usr/local/Cellar/ruby/1.9.3-p392/lib/ruby/gems/1.9.1/gems/actionpack-3.2.9/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (8.9ms)
[2013-03-11 20:35:46] WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

thanks

Needs model-level validations

Currently, validations are handled in forms by bootstrap. This isn't very robust - model-level validations would be better.

Contact ids are undefined immediately after creation

After creating a contact, the user is transitioned to the newly created contact's page. Because the contact does not yet have an id, the route is /#/contacts/undefined. This leads to deserialization problems for the route when using the browser's back button.

bundle exec rake test fails

First of all it failed because phantomjs wasn't installed on my system, e.g. should be part of the build process as a dependency.

$ npm install phantomjs -g

However, I still get the following error:

$ bundle exec rake test
...
Adding a new contact::with valid data
     test_0001_should create the record and then show its details        ERROR
        Unable to find link or button "Create"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.