similar to: respond_to issue

Displaying 20 results from an estimated 3000 matches similar to: "respond_to issue"

2008 Jan 30
2
Where can I get "authenticate_with_http_basic"?
Hi, I just installed Rails 2.0.2 [root@mymachine easyx]# ruby --version ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux] [root@mymachine easyrx]# gem install rails --include-dependencies Need to update 16 gems from http://gems.rubyforge.org ................ complete Successfully installed rails-2.0.2 [root@remandev easyrx]# But I''m getting this error in my restful_authentication
2006 Apr 08
2
respond_to causes DoubleRenderError?
I have a custom authentication plugin that redirects users to a login site if they aren''t already authenticated and their session hasn''t timed out. I had things working fine with straight http requests, but wanted to add support for ajax requests. I thought this would be a simple matter of replacing all of my "redirect_to <blah> and return false" calls with
2008 Mar 07
0
ActiveRecordStore: cleanup & avoiding duplication
Hi, I''m using ActiveRecordStore to track user sessions. I''ve used as a base the next sources: - http://blog.levicole.com/articles/category/ror - http://matt-beedle.com/2006/12/13/rails-how-to-find-out-who-is-online/ - http://www.williambharding.com/blog/?p=99 This is what I currently do: IN SESSION CONTROLLER def create self.current_user = User.authenticate(params[:login],
2008 Apr 20
1
Why is respond_to always rending the RXML view?
I''m having a problem in Rails 2 where respond_to is always rendering the RXML view even in the HTML rendering response. Can anyone tell me why this might be happening? Here''s a code snippet: respond_to do |accepts| accepts.html accepts.xml { render :action => ''show.rxml'', :layout => false} end If I change this to the following it works fine:
2006 Aug 14
1
respond_to? in acts_as_ferret results
acts_as_ferret''s search results use #method_missing to forward method calls to the underlying result object. However, those methods are represented in #respond_to? Here''s a simple fix for that: module FerretMixin module Acts module ARFerret class SearchResults def respond_to?(name) self.methods.include?(name) || @results.respond_to?(name)
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
2006 Jun 08
0
custom mime types for respond_to
Is there a way to add a mime type of my own to respond_to ? There''s html, xml, js, ical etc ... But I want to be able to respond_to Excel. Excel has the following content-type header: application/vnd.ms-excel I want to use the new ?format=xml querystring parameters that respond_to can respond to. So I want to pass in ?format=xsl or ?format=ms-excel so that I can return my results
2008 Jun 24
2
wrong number of arguments (1 for 0) when using respond_to?
Trying to get an otherwise working app (in Rails 2.0.2) up to speed with Rails 2.1.0 and Ruby 1.8.7, I have some broken code I can''t seem to fix: module Pathmaker def self.append_features( base ) base.before_save do |model| model.path = model.name.downcase. gsub( /\ and\ /, ''-'' ). gsub( /\ on\ /, ''-'' ).
2006 Jun 28
2
respond_to and Accept headers
After reading: <http://www.loudthinking.com/arc/000572.html> I''m trying to experiment with respond_to in order to not repeat myself and create atom feeds out of a "browse" view. In application controller I created a before filter that checks for the extension of the current url and changes the accept header: [code] def check_headers @headers["Accept"]
2007 May 28
2
Rails, respond_to? over anonymous module (extend has_many).
Hello List, I''m trying to generate examples for some list-helpers I have coded which use in my projects. Basically, the Playlist class uses one anonymous module in has_many that acts as helper between acts_as_list and my desired API: class Playlist < ActiveRecord::Base # associations go here has_many :playlist_items, :order => :position, :dependent => :destroy has_many
2010 Aug 21
1
Rendering a different Javascript file in respond_to
Hi everyone, I am stuck in an (apparently) simple problem. In my event_controller I have the i_like_it action: def i_like_it @event = Event.find(params[:id]) ... # logic respond_to do |format| format.js end end In my case "i_like_it" is called with :method => PUT (it is an Ajax call, "i_like_it.js.erb" will be returned as a script and it wil be
2012 Feb 20
1
respond_to format.json not being called
Hi all, I''m submitting a form using jQuery, but in the respond_to block only the format.html action is called. This is the javascrip: send_button.on(''click'', function(){ var form = $(this).closest(''.modal'').find(''form''); $.post(''/messages'', form.serialize(), function(data, status, xhr){
2008 Jan 16
0
respond_to, mime types and excel
Hello All, I''m trying to figure out how respond_to actually works, especially with the increased focus on REST. After I set a MIME type for Excel Mime::Type.register "application/vnd.ms-excel", :xls In my index action''s respond_to block I have format.xls { @parts = Part.find(:all) headers[''Content-Type''] =
2007 Jan 20
0
Best way to force a respond_to format
I am playing around with the idea of adding to the HTTP_ACCEPT header method and trying to utilize WURFL for detecting mobile devices by USER_AGENT instead. I''m thinking I will set up some kind of before_filter in my controller, to intercept all requests and compare the USER_AGENT to some data source. If I detect that the USER_AGENT is a mobile device, then I''d like to force a
2007 Jul 07
0
respond_to for unknown type
Greetings, How would I go about handling an unknown type in a respond_to block? That is, I currently have ... respond_to do | format | format.html { do something } format.xml { do something else } end I would like a handler for all other format''s, other than html/xml, so that I can, for example, log the request, render an error or whatnot. Thank you, ]{
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
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
2006 Mar 22
1
undefined method `respond_to'' when using Exception Notifier Plugin
I''m trying to use the exception notifier plugin and I''m getting this error message: NoMethodError (undefined method `respond_to'' for #<Adm::PeriodController:0xb74c9804>): /vendor/plugins/exception_notification/lib/exception_notifiable.rb:64:in `render_500'' /vendor/plugins/exception_notification/lib/exception_notifiable.rb:76:in
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 Jul 31
1
Please help, if @jobs[key].respond_to? :thread is returning false
I noticed in the BackgroundRB class in the delete_worker method there is a line: if @jobs[key].respond_to? :thread For some reason this is returning false for me, it gets down to this line and returns false, not killing the thread. Any idea why this is returning false? Thanks for your help. Thank You, Ben Johnson E: bjohnson at contuitive.com -------------- next part -------------- An