On 7 February 2014 21:24, Bob Kendall <ikendallohio@gmail.com> wrote:
> am running ruby 1.9.2 and rails 3.2. I have active record call that is
> returning nil even though the data is there. So my question is, what part am
> I missing to return the records?
Look in development.log where you should find the sql generated.
Looking to see what is wrong with that should give you a clue.
Colin
>
> my model is:stores.rb
>
> class Stores < ActiveRecord::Base
>
> establish_connection "as400_#{RAILS_ENV}"
> set_table_name "SIGNCUSTM2"
>
>
> def self.find_stores(params)
> Customer.where("CAD505=? AND TRYT20=?", params[:parmstate],
> params[:parmrep]).where.not(cusn05: nil)
> end
>
> def index
> @customers = Customer.find_stores(params[:model])
> end
>
> end
>
> my view: store.html
>
> <% @customers |customer| %>
>
> <p align="center">
>
> <strong>Store:</strong> <%= select_tag :customers %>
> </p>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/bbe295e9-a5be-4015-b006-9dc85e988aa7%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLsKGfJ5EOkmEvMMv7dS8RYWg7o8QfUZ7htJuKLRLr2n-g%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment