I am fairly new to rails. I have the following models
class Question < ActiveRecord::Base
has_many :options
has_many :response_parts
end
class ResponsePart < ActiveRecord::Base
belongs_to :question
end
The corresponding scaffolds are
rails g scaffold Question qorder:string qtext:text qtype:string
rails g scaffold ResponsePart answer:string question:belongs_to
Now I want all the response parts where qtype is 'mobile'. I have tried a few ways but could not query successfully. Can someone tell a way to make such query. Thanks in advance.