Displaying 20 results from an estimated 2000 matches similar to: "Using rack.hijack with ActionController::Live"
2012 Jul 23
4
uninitialized constant ActionController::Flash::FlashHash [NameError])
My application, a very simple general ledger, that worked very well until
June 26 does not work any longer. It is used under Ubuntu 12.04 and I
believe there was a Ruby update after that.
What happens?
When I try to start the appIication I get the following output in my web
browser:
ActionDispatch::Session::SessionRestoreError
Session contains objects whose class definition isn''t
2010 Dec 15
2
Error reverse engineering MySQL with RMRE
Hi
I am been trying in vain to auto-gen models by reverse-engineering
mysql using RMRE. It complains mysql2 gem missing but as seen in my
Rails environment below, it is there.
Here''s my Rails environment and RMRE error. Experts... please help!
Thanks a ton in advance!!
===
Ruby version 1.9.2 (x86_64-linux)
RubyGems version 1.3.7
Rack version 1.2
Rails version 3.0.3
Active Record
2010 Nov 19
1
Help: delegated association 'App' returning ActionDispatch::Integration::Session instead
class Foo < ActiveRecord::Base
has_one :bar
delegate :app, :to => :bar
end
class Bar < ActiveRecord::Base
belongs_to :app
def self.attribute_column_names
return @@attr_columns if defined?(@@attr_columns)
readers = content_columns.map { |n| n.name.intern } -
[:created_at,:updated_at]
@@attr_columns ||= readers.map { |k| [k, "#{k}=".to_sym] }.flatten
end
2013 Jun 08
1
ActiveSupport::Concern support Module#prepend?
I''ve monkey patched this behavior into a gem and I was wondering if core
would be interested in a PR to add Module#prepend support to
ActiveSupport#Concern. I''ll add tests of course.
The code is here:
https://github.com/dockyard/easy_auth/blob/master/lib/easy_auth/active_support/concern.rb
My monkey patch work for what I''m trying to do but I suspect a better
2011 Jul 31
2
Looks like an error in docs for ActionDispatch::Routing::Mapper::Resources
Please take a look at this page:
http://api.rubyonrails.org/classes/ActionDispatch/Routing/Mapper/Resources.html#method-i-resource
It reads:
:path
Set a path prefix for this resource.
resources :posts, :path => "admin"
All actions for this resource will now be at /admin/posts.
For me (Rails 3.0.9) it routes to just "/admin", not "/admin/posts".
2010 Nov 17
3
How to use request helpers outside of controller specs?
I asked this questions on some other places before, but have found no
solution yet. I''d like to include the request helper (from
ActionDispatch::Integration::RequestHelpers, like post and xhr
methods) also in some specs outside of my controller specs. The
problem is that these request helpers are only included in spec/
controller and when a controller is described.
What do I have to
2013 Jul 22
0
How to handle exception that is generated in rack middleware before it reach rails app?
I know that we can use config.exception_app to set up custom exception
handling and also use rescue_from. However, I have an issue that there is
malformed request (testing generated request) that caused Rails Rack
middleware to throw an exception when Rack''s parse_query method. Here is
the detail of the
problem:
2012 May 13
1
is assert_select_rjs deprecated in Rails 3.1 ?
I have seen it in 3.0.9 doc (
http://apidock.com/rails/v3.0.9/ActionDispatch/Assertions/SelectorAssertions/assert_select_rjs
)
but it''s not mentioned in the latest guide (
http://guides.rubyonrails.org/testing.html#integration-testing-examples)
if deprecated how can I check the view from an Ajax call
( assert_match + gsub could work ? ... )
am I missing any doc ?
xhr :get, :change_area,
2010 Sep 21
7
Ajax CSRF in Rails3
I''m using rails3. It does not seem to check the authenticity_token
when doing a POST using Ajax. I traced this to:
module ActionDispatch
class Request < Rack::Request
.....
def forgery_whitelisted?
get? || xhr? || content_mime_type.nil? || !
content_mime_type.verify_request?
end
end
so you don''t check if its a get? or a xhr? (ie ajax request). Is this
correct?
--
2011 May 16
2
Cannot get multipart => true , running well in my form when using remote => true
I have a simple form , with a file field
= form_for (Clip.new), :html => {:multipart => true} , :remote =>
true , do |f|
= f.hidden_field :user_id, {:value => current_user.id}
= f.text_field :name
= f.text_area :description
= f.file_field :image
= f.submit I18n.t(:add)
generating the html code
<form accept-charset="UTF-8"
2012 Jun 08
1
[Rails 3.2.5] Rails: unit test fixture_path : fixture_file_upload cannot find the file ...
I am trying to perform a test unit, using FactoryGirl
include ActionDispatch::TestProcess
FactoryGirl.define do
factory :article do
.......
photo { fixture_file_upload ''/files/test.jpg'', ''image/jpg'' }
end
end
IN mt test_helper.rb I defined the fixture_path
def fixture_path
File.dirname(__FILE__) + "/fixtures/" #
2013 Jan 03
6
How to avoid simple race conditions with Session?
Here is the situation:
- the client makes a request
- it is followed by AJAX polling
The server needs to keep track of some stuff during this process.
I have been using the Session and it "mostly" works… until the user
decides to open another tab in her browser and she makes a new,
parallel request. In this case, the data from the two requests is
merged, which leads to bugs.
This got
2012 Jun 02
1
Determining frequency and period of a wave
Hello! I'm collecting data on a refrigerator that I'm using to cure
meat. Specifically I am collection humidity and temperature readings.
The temperature readings look sinusoidal (due to the refrigerator
turning on and off).
I'd like to calculate the frequency and period of the wave so that I can
determine if modifications I make to the equipment are increasing or
decreasing
2008 Sep 08
2
Restful Authentication and State Machine state transfer question
I''m adding some code to a project using restful_authentication and
acts_as_statemachine
In the create method for a user there is the following code generated
by the restful_authentication template
@user.regster! if user.valid?
And this will save and the user record if it is valid. I understand
that the statemachine will then change the state from passive to
pending. It will guard
2010 Apr 26
2
/lib/rack/request.rb in my gem - is this reserved?
Hi!
I write a gem at the moment. The Gem need to register during the
process in the rack middleware.
So I make an folder "rack" inside my "lib" folder. I called the file
"request.rb" because it keeps track of requests.
So we speaking about the file /lib/rack/request.rb
But even if I place an empty file on this, I get the following:
2010 Dec 17
1
flash[;notice] not display after redirection
I read all previous posts about the same subject in Devise group but
couldn''t find any answer, so iy may not be related to Devise , so
I debugged it ..
.
class Users::RegistrationsController <
Devise::RegistrationsController
..
# POST /resource/sign_up
def create
build_resource
if resource.save
if resource.active?
set_flash_message :notice, :signed_up
2011 Feb 08
4
Remove ActiveRecord::Relation#& alias for 'merge' ? (or at least only reference and not use in AR)
Would the core team be open to the removal of the ''&'' alias for
ActiveRecord::Relation#merge?
The reason is that in Ruby the ''&'' operator refers to an intersection
of two sets of data, not a merge. (within the context of the Array
class)
Recently Arel added support for SQL Set Operators:
2-0-stable:
2006 Jun 23
4
Ajax.Request with page reload?
I need to send a POST request via a link, along with paramater data for
an action, and the page needs to reload. link_to_remote worked great
when I was updating a DOM element but obviously won''t work when I need
to reload a page. Is there an option
--
Posted via http://www.ruby-forum.com/.
2011 Feb 28
4
best_standards_support
File ./lib/rails/generators/rails/app/templates/config/environments/development.rb.tt:
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
File ./lib/rails/application.rb:
middleware.use ::ActionDispatch::BestStandardsSupport,
config.action_dispatch.best_standards_support if
config.action_dispatch.best_standards_support
What''s
2006 May 18
3
Two-Dimensional Hashes through links?
I''m really hitting a wall here. My program has a search engine, returns
a list of results. I am using a two-dimensional hash to pass the form
data back to my controller. (i.e. params[:job] => {:description =>
"xxx", :location => "xxx", company => "xxx"}) I use that Job object to
search my database, and then wait for user input.
Now when the