Displaying 7 results from an estimated 7 matches for "localjumperror".
2012 Oct 18
0
unexpected return (LocalJumpError) only when executing this code within autoloaded classes?
...fig/environments/development.rb`, it works fine and continues to work.
But, when I call it in `app/controllers/application_controller.rb` above or
below the class definition, Rails dies during autoloading in
activesupport-3.2.8/lib/active_support/dependencies.rb:469 due to an
unexpected return (LocalJumpError).
Here is the log:
return
/path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/railties-3.2.8/lib/rails/initializable.rb.30
#<Binding:0x007ff7b1403d40> Rails::Initializable::Initializer run
return
/path/to/.rvm/gems/ruby-1.9.3-p194@some_app_gemset/gems/railties-3.2.8/lib/rails...
2007 Dec 29
2
Sending methods after classifying
The following code gives me an error:
class_vars = [''fruit'',''cow'',''coffee''].each do |class_var|
"#{class_var}".classify.send(:find, 1 + rand(10))
end
The error message stack:
LocalJumpError: no block given
from (irb):34:in `find''
from (irb):33:in `each''
from (irb):33:in `find''
from (irb):33:in `send''
from (irb):33
from (irb):32:in `each''
from (irb):32
from :0
What I am trying...
2007 Jun 09
11
authentication, controller specs. I think I''m missing something simple ....
...g.find(:all)
I run "rake spec" and of course it fails. So, I try to mock/stub the
current_user and add a stub for the things method on it and it''s at this
point that I feel like I''m missing something fundamental since I get
many many failures of various types.
LocalJumpError in ''ThingsController handling GET /things should
render index template''
no block given
is the major error. If I remove the "find(:all)" a number of these
LocalJumpErrors disappear. I am interested in how to resolve the
LocalJumpError issue tho since I&...
2007 Oct 26
1
Custom method in Application Controller
...City or State models and I had
hoped it would look something like this:
def load_data(model)
@model.pluralize = Model.find(:all)
end
and I call the method like so:
AddressesController<<ApplicationController
def new
load_data(:City)
load_data(:State)
@address = Address.new
end
but I get a localjumperror exception thrown in the "new" method in the
Address controller with the error message "no block given"
does any one have any idea on how to rewrite this method so that I can
call it from any controller and initialize a hash that references the
model I pass as a parameter
Thank...
2012 Oct 17
2
autolog: set_trace_func without all the typing
If it helps anyone developing Rails, apps, or gems, I wrote a shortcut for
set_trace_func, so next time you want to just add a line before and after
some function you are trying to debug you can have Ruby temporarily output
every line, method, etc. executed. Also, it lets you define the format, use
other loggers, etc. via a proc/lambda define, since you might not like the
default format.
2013 Aug 31
6
wxruby and wxwidget-2.9.5 latest
is there a way to have wxwidget-2.9 working with ruby ? seems that the
latest wxwidget is better for use with mac osx...
so, there is many widget who are not been implemented in the last
version of wxruby... like wxFilePickerCtrl (and other).
Also, it seems like the wxruby project is dead since 2009. Is it right ?
So, do you know if someone seriously have intention to follow the
project or is it
2008 Jun 15
7
Getting "no block given" on find method - rails 2.1
I am trying to do a simple find through the current_user but get an
exception. Either someone spiked my Starbucks coffee and I am screwing
up all over the place or there is something wrong.
def index
@league = current_user.leagues.find(13)
end
# Error
LocalJumpError in Admin/schedule todosController#index
no block given
If I pass a block to it it works fine, but it is just messy:
=====
current_user.leagues.find{ |l| l.id = 13}
Thanks for the help.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received t...