search for: responds_to

Displaying 13 results from an estimated 13 matches for "responds_to".

Did you mean: respond_to
2007 Dec 06
2
Implementation of rest in ROR
Hi all, I am new to ROR world. I know the REST conceptually but find the difficulties in implementation can anybody guide me that which is the best book which i have to read. also some good links of implementation of rest in ROR. If anybody made a small application to restful in rails please forward me that application. i found some demo but i didn''t understand for what purpose they
2007 Nov 02
2
Test that controller includes helpers?
Is there an easy way to spec that a controller should include helpers other than its own? I was thinking I could just spec responds_to for methods I''m interested in in the view, but that seems like crossing a separation boundary, that the controller maybe doesn''t need to know about? Thanks, Steve
2006 Aug 03
1
Why doesn''t redirect_to handle rjs?
Is there a good reason why redirect_to doesn''t check responds_to, so it can handle redirects in rjs calls? I''ve done something like this in my app controller, seems to work ok... alias_method :redirect_to_orig, :redirect_to; def redirect_to(options = {}, *parameters_for_method_reference) respond_to do |accepts| accepts.html do...
2006 Jun 05
1
Unobtrusive javascript...what if?
...9;'bar'', :unobtrusive => true %> # which produces <form id="form_foo_bar" action="/foo/bar" method="post"> [/php] But which still acts as an ajax form? You would simply handle the response for ajax and non ajax requests using Rails'' responds_to function. In addition, what if you could attach javascript functionality to your page elements in a Behaviour-like fashion, but using pure Ruby, anywhere in your view, but loaded from an external Javascript file? Sorry to tease. Stay tuned, we have something very cool to show off in the next day...
2012 May 11
14
What is the point of using :format in routes?
Today I had a strange behavior that made me suspect of jQuery at first, but then it happened that I''ve faced two gotchas, one from CoffeeScript and one from Rails itself. I have something like this: routes.rb post ''/fields/:id.:format'' => ''fields#show'', as: :field, constraints: {id: /\d+/} post ''/fields/remove/:id''
2007 Sep 20
11
Proposed API change for respond_to
Ez (or someone) asked on #merb tonight whether respond_to was the right API for what it does. After some discussion and pasties, I offer the following proposed API for content negotiation and response format selection: First, what does respond_to do right now? I see at as performing 3 distinct operations: 1. parse params[:format] and the accepts header to find out what format the
2006 Jul 07
4
Controllers - model vs. use case centric
I am working on a reasonably large application (which happens to be my first with rails). I was hoping to get some input on organisation of controllers and actions. I am finding having used scaffolding more at the beginning my controllers tend to be very model centric, in that they mostly contain all the actions for management of that particular model, which may crash across multiple use
2007 Mar 06
15
mocking missing methods
Hi folks. So I''m using mocha on a ruby project, and I really like it. One thing I''ve noticed is that it can be a bit "surprising" when I''m mocking methods that don''t exist on an object, and I think there''s an easyish fix. At the moment, you use sheep = mock() to create a mock sheep. What I''d like to do is something like sheep =
2007 Aug 30
0
No method exception - figured it out
...of String, the drb server was not properly unmarshalling the object. I fixed it by calling to_s on all my strings. ActiveRecord and the local ferret server handled this fine, but the remote one chokes. The error was masked twice by the exception trapping code in acts_as_ferret. How about using responds_to? instead of catching NoMethodError so that underlying errors will be exposed. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ferret-talk/attachments/20070830/0dc08cbf/attachment-0001.html
2006 Aug 15
0
Mocha - dynamic method calling
...ook.method(''lookup'').call(''jim'', ''johnson'', ''tx'') end ... but it doesn''t seem to replace the "method" method as I would expect. I''ll have to look into this a bit further. > I had to put in the responds_to stuff so that my code wouldn''t just > inject the methods; it injects accessors if they do not exist. The > responds to fix you suggest would fix this problem. I''d just put both > accessors in expectations and it would be good to go. I intend to fix this soon as I menti...
2006 Nov 02
5
nesting content from multiple controllers
Hi guys. Here''s something I''ve been struggling with for a while: if you want to nest a login box on, say, a welcome page, but the login stuff is handled by the login controller while the welcome page is the welcome controller, what are your options? Iframe? Krister --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to
2006 Feb 26
0
Review of Black, Ruby for Rails, Chapter 4
...". He even shows how a "puts" expression returns nil (using irb) and how that may be significant for a developer to know. There is also a discussion of object identity and object equality. This leads to a discussion of some of the other methods from the Object class, like "responds_to?" and "send". I found that helpful, because I obviously need to learn the Ruby libraries and this is an easy introduction to them. The next section talks about required, optional, and default-valued arguments. Until version 5.0 (or 1.5, depending on your point of view), Java ha...
2006 Jul 19
12
[Slightly OT] POSTing data to a Rails App
Hi, I have a Windows program that collects data and would like to store this data in a database that is usually accessed through Rails. It was recommended that I try to "POST" the data to the Rails application. I''m running into some problems trying to format my POST string for the application. I''m trying to learn by interfacing to the TODO application (Four Days