NoMethodError undefined method '-@' NoMethodError in Controller Ruby on Rails -
NoMethodError undefined method '-@' NoMethodError in Controller Ruby on Rails -
context: pulled recent code repository , tried create sure changes force going work version of code. ruby on rails application. worth noting fact when running main application pulled on web, error not show up. if run branch or main branch cloned onto environment, error shows every url try. on end.
problem: go localhost:3000, next error:
nomethoderror in homecontroller#index undefined method `-@' #<actiondispatch::response:0x64fd460>
what i've tried: have asked question on #rubyonrails irc channel , nobody able determine going on through total trace (i haven't posted here because wasn't sure best way on here; didn't in code block or block quote). have looked @ homecontroller's index method, defined such:
def index @groups = @current_user.groups @things = thing.where(:group_id => @groups.map{|e|e.id}) end
i have googled around , haven't found need prepare problem.
what i've learned far: -@ operator. people may receive similar error in assuming ruby has shortcut to
variable = variable + 1
that lot of other languages have:
variable++
here illustration of case: undefined method `+@' false:falseclass (nomethoderror) ruby
question: have farther suggestions on how find issue here? also, if set total trace on here, formatted in aesthetically pleasing manner, tell me how? i'm @ loss 1 :(
update (2/8/2013): seems issue not reside in homecontroller nor home/index.html.erb view. have attempted access url valid action , same error occurs "nomethoderror in..." changing corresponding [...]controller#index.
update (2/9/2013): since error happens no matter url seek navigate to, decided in routes.rb file in config folder. ran server through rubymine instead of command line time, made little easier read me. started looking through spit out , noticed interested line consisted of:
["private-key looking thing"] [127.0.0.1] started "/" 127.0.0.1 @ 2013-02-09 18:20:52 -0700
it seems there syntactical error in routes.rb (that's best guess @ point). not explain why issue on local environment same code sets, else have go off of?
does have suggested things on out while sift through file? not sure looking far errors concerned. rubymines inspection stuff converted double quotes single quotes , doesn't have else complain about.
thanks in advance, jake smith
i guessing might syntactical error in corresponding view page home/index.html.haml .. suspecting there unintended '-' in front end of variable call. tried simulate similar scenario in rails platform , see next page on browser
undefined method `-@' false:falseclass
correct lines of code
%h1 movies = "filtervalue=#{@isfilterold}" = "sortvalue=#{@issortold}"
edited simulate error (observe - in front end of isfilterold variable)
%h1 movies = "filtervalue=#{-@isfilterold}" = "sortvalue=#{@issortold}"
ruby-on-rails controller nomethoderror unary-operator
Comments
Post a Comment