similar to: respond_to format.json not being called

Displaying 20 results from an estimated 3000 matches similar to: "respond_to format.json not being called"

2011 Mar 17
7
Beta Invitation in Rails 3, little problem
INVITATION BETA EMAIL I have in the email that the app send to friend''s email address ------------------------ You are invited to ExampleApp.com click below to signup http://localhost:3000/signup.efweiuvwnjernfwkefwebhsohj ------------------------ But I have a dot in the url beteween http://localhost:3000 and the token I wish the following url
2008 Sep 10
5
xmlhttprequest for updating
Hello, I am updating an object with an AJAX form: view: <% remote_form_for(@sample, :update => "content2") do %> <p> parameter: <br /> <%= select("sample","parameter",Parameter.find(:all).collect {|p| [p.description.gsub(''_'', '' ''),p.id]},{},{:size => 4, :multiple => true}) %>
2006 Jun 24
5
request.xhr? vs. respond_to
Searched around this forum, but didn''t find an answer for this question. Can you help this newbie understand any overlap and/or difference between request.xhr? and respond_to? If request.xhr? is true, should I expect it wants.js below? respond_to do |wants| wants.html { redirect_to(person_list_url) } wants.js wants.xml { render :xml => @person.to_xml(:include
2007 Apr 26
2
assert_select with respond_to JS or xhr?
Hi everyone, I am a bit confused with xhr? and respond_to. I have the folloing code in my view to update the ''emails'' ID link_to_remote(image_tag("refresh"), :update => "emails", :url => { :action => "list_emails" }) in the controller side i have somthing like : [..] respond_to do |type| type.html { render :action
2008 Mar 18
4
respond_to formats, fbml and fbjs
In my controllers I have a respond_to block for both fbml and fbjs. I created the fbjs mime type in environment.rb: Mime::Type.register "application/javascript", :fbjs However, even if I specify fbjs in a parameter name format during AJAX post requests, it is being overwritten by Rails or Facebooker as FBML. I confirmed this by placing logger.debug params[:format] immediately before
2006 Aug 30
10
respond_to not detecting JS turned on. form_to_remote problem?
I''m trying to use respond_to to redirect visitors who have JS turned off to a different page. The problem I''m having is that respond_to is sending *everybody* there. It''s not recognizing that JS is turned on in the browser. The wanted_html.rhtml file below is rendered whether I''ve got JS turned on or off. I''ve looked at the Accept headers being sent
2012 Sep 18
4
"best practices" for Rails serving RESTful JSON services for use by AngularJS, Ember.js, etc.
I''ve been writing a gem to implement and extend common controller functionality so that Rails can be used with Javascript frameworks like AngularJS (which we are using), Ember.js, etc. in such a way that the user doesn''t have to tweak a a bunch of rails g controller boilerplate code to provide services for use in these frameworks that in turn would require various changes to
2012 Mar 10
4
undefined local variable or method 'game'
I am doing a web shop assignment and have got a problem with my action mailer. I get an error undefined local variable or method ''game'' I have the following in my mailer: def game_interest(user, game) @user = user @game = Game mail :to => user.email, :subject => "Game Interest" end and the following in my controller: def email @game =
2009 Feb 22
8
dynamically changing a form from POST/CREATE to PUT/UPDATE
For the life of me I can''t figure this one out, although I can''t find anyone else who''s attempted to do this, and probably with good reason. Context: blog using AJAX What I''m trying to do: when the user initially saves a blog entry, or when auto-saving, I want subsequent saves to not create a new blog entry Why I can''t just reload the partial: -
2006 Nov 23
2
Some tips for testing respond_to block and making controller tests work with simply_helpful
Hi, Here''s two blog posts for those that need to test respond_to blocks and/or are currently using simply_helpful extensively. http://blog.methodmissing.com/2006/11/22/testing-different-content- types-with-rspec http://blog.methodmissing.com/2006/11/23/using-simply_helpful-with- rspec-controller-tests - Lourens
2011 Jul 11
2
Can't get this Rspec test to pass
Hello, I''m completely new to Rspec testing and I''m finding it very difficult to mock specific objects. In this test, I have a before block setup as such: [code] before do setup_controller_for_warden controller.session[:operation_id] = 1 @operator = Factory :operator sign_in :operator, @operator @persist_herd = Herd.new
2011 Feb 15
5
Path and Url
Hello everyone, what''s the real difference between root_url and root_path in Rails, for example. Apparently both lead to the same route in the application. Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To
2010 Sep 04
3
its easy but i forgot all
my models borrower ----- has_many :loans loan ----- belongs_to :borrower my loans _controller def new @borrower = Borrower.find(params[:borrower_id]) logger.debug '' @borrower.id'' logger.debug @borrower.id @loan = Loan.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @loan } end
2009 Jan 30
3
Pass a variable from rake to steps file in cucumber
Can anybody tell me how to pass a variable from the rake command to my steps file using cucumber? I have the following in my Rakefile: ## Rakefile Cucumber::Rake::Task.new do |t| profile = ENV[''PROFILE''] || ''default'' browser_type = ENV[''BROWSER''] || ''*chrome'' t.cucumber_opts = "--profile #{profile}" end I
2007 Feb 08
3
testing ajax responder actions
I have an Ajax responder method which uses respond_to to make sure it only works with Ajax. I''m having trouble figuring out how to call this action successfully. I''m using Rails 1.2.x. Any thoughts? -- Cheers, Kevin Williams http://www.almostserio.us/ "Any sufficiently advanced technology is indistinguishable from Magic." - Arthur C. Clarke
2011 Nov 23
0
Awesome nested set - how to put there items?
hello guys, I have following structure of the table, where I store items of tree: | id | int(11) | NO | PRI | NULL | auto_increment | | user_id | int(11) | YES | | NULL | | | parent_id | int(11) | YES | | NULL | | | lft | int(11) | YES | | NULL | | | rgt | int(11) | YES
2009 Dec 02
14
root_path and root_url undefined
Hi all, I''ve just started working on another RoR project after a couple of months away. I''m having trouble with named routes, specifically root_* In previous apps I''ve used root_path and root_url without any problems, but in this project (2.3.2 - the same as my last project where I used it) it comes up undefined. I''ve double and triple checking my routes.rb,
2007 Dec 22
3
collection_select validation problem
I''m trying to assign a parent foreign key value using collection_select from my child "new" form. The problem I''m having is if I do not make a selection, I get the following error instead of the Rails validates_presence_of error: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occurred while evaluating
2013 Apr 02
4
gmaps4rails: undefined method `model_name' for NilClass:Class
Hi All, just in a spot of bother with this gem, I am trying to create a new location and get the above msg. here is my controller: class LocationsController < ApplicationController # GET /locations # GET /locations.json def index @locations = Location.all @json = Location.all.to_gmaps4rails end respond_to do |format| format.html # index.html.erb
2010 Mar 02
1
localized host in ActionMailer Views
Hi, I''ve got some domains , lets say example.com and example.de and I want that the link in a ActionMailerView contains the correct localized host e.g. with <%= @root_url %> . Currently the host is set in the environment.rb with "config.action_mailer.default_url_options = { :host => "example.com" }". How can I set the host dynamically and localized?