Search Results

Search found 4 results on 1 pages for 'brg'.

Page 1/1 | 1 

  • Previously working emberjs1.0-pre form on jsfiddle returns "error": "Please use POST request"

    - by brg
    This code ** http://jsfiddle.net/wagenet/ACzaJ/8/ ** was working a few days ago, when i returned to it today, it throws {"error": "Please use POST request"}, when i click add button Also the jsfiddle editor.js always throws exception on this line: function stop(){cc = stop; throw StopIteration;}; Does anyone knows the cause of this issue. Many thanks Update 1 Based on @Peter Wagenet's suggestions below, the form now logs entries or inputs to the console but it doesn't display on the result section of jsfiddle instead what is displayed on jsfiddle result section or page is still this error {"error": "Please use POST request"} ** http://jsfiddle.net/ACzaJ/18/ Update 2 In this fiddle, http://jsfiddle.net/ACzaJ/19/, i have successfully eliminated this error {"error": "Please use POST request"} by adding event.preventDefault(); to the submit action in Todos.TodoFormView. That allows us to use arbitrary view methods as action handlers. The existing issue is that the input to the form, only displays on the console and not on jsfiddle result section, though no error displays on the result section, there is a new error appearing in the console of the updated fiddle: Uncaught Error: Cannot perform operations on a Metamorph that is not in the DOM. Finally solved I needed to comment out App.initialize() for it to work as expected. This the working fiddle ** http://jsfiddle.net/ACzaJ/20/. I don't know why that is so, but my guess is that, App.initialize works with other parts like the router for routing, ApplicationController and ApplicationView with {{outlet}} in the handlebars, which i didn't need for this fiddle. Finally Finally and completely solved This ** http://jsfiddle.net/tQWn8/ works with App.initialize. But you have to declare all those components above and pass the router to App.initialize, like this App..initialize(router). If you don't do this, then you will get the old error Uncaught Error: Cannot perform operations on a Metamorph that is not in the DOM.

    Read the article

  • rails 3.0.3 - ActiveRecord::Relation, undefined method error

    - by brg
    I am having this unexplained ActiveRecord::Relation, undefined method error . I don't know why, since my model association are well defined and the event table has the foreign keys for the user table. I tried using this fix but it failed: Rails 3 ActiveRecord::Relation random associations behavior event.rb class Event < ActiveRecord::Base belongs_to :user attr_accessible :event_name, :Starts_at, :finish, :tracks end user.rb class User < ActiveRecord::Base has_many :events, :dependent = :destroy attr_accessible :name, :event_attributes accepts_nested_attributes_for :events, :allow_destroy = true end schema.rb ActiveRecord::Schema.define(:version = 20101201180355) do create_table "events", :force = true do |t| t.string "event_name" t.string "tracks" t.datetime "starts_at" t.datetime "finish" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" end end error message NoMethodError in Users#index undefined method `events' for # Extracted source (around line #10): 7: <%= sortable "Tracks" % 8: 10: <% @users.events.each do |event| % 11: <% debugger % 12: 13: <%= event.starts_at % Trace of template inclusion: app/views/users/index.html.erb Rails.root: C:/rails_project1/events_manager Application Trace | Framework Trace | Full Trace app/views/users/_event_user.html.erb:10:in _app_views_users__event_user_html_erb__412443848_34308540_1390678' app/views/users/index.html.erb:7:in_app_views_users_index_html_erb___603337143_34316016_0'

    Read the article

  • undefined method `events' for #<ActiveRecord::Relation:0x4177518> -rails 3.0.3

    - by brg
    I am having this unexplained NoMethodError with undefined method `events' for #. I don't know why since my model association are well defined and the event table has the foreign keys for the user table. I tried using this fix but it failed: Rails 3 ActiveRecord::Relation random associations behavior event.rb class Event < ActiveRecord::Base belongs_to :user attr_accessible :event_name, :Starts_at, :finish, :tracks end user.rb class User < ActiveRecord::Base has_many :events, :dependent = :destroy attr_accessible :name, :event_attributes accepts_nested_attributes_for :events, :allow_destroy = true end schema.rb ActiveRecord::Schema.define(:version = 20101201180355) do create_table "events", :force = true do |t| t.string "event_name" t.string "tracks" t.datetime "starts_at" t.datetime "finish" t.datetime "created_at" t.datetime "updated_at" t.integer "user_id" end end error message NoMethodError in Users#index undefined method `events' for # Extracted source (around line #10): 7: <%= sortable "Tracks" % 8: 10: <% @users.events.each do |event| % 11: <% debugger % 12: 13: <%= event.starts_at % Trace of template inclusion: app/views/users/index.html.erb Rails.root: C:/rails_project1/events_manager Application Trace | Framework Trace | Full Trace app/views/users/_event_user.html.erb:10:in _app_views_users__event_user_html_erb__412443848_34308540_1390678' app/views/users/index.html.erb:7:in_app_views_users_index_html_erb___603337143_34316016_0'

    Read the article

1