def cities
@cities = Store.find_by_sql("select DISTINCT city from stores where
state='#{params[:state]}'")
end
I have a file called cities.rjs. However, when I run it, I get the
following error:
ActionView::MissingTemplate (Missing template stores/cities.erb in view
path app/views:vendor/plugins/easy-fckeditor/app/views):
I’ve tried creating a file called cities.erb, but that doesn’t work
either. The path is correct: I have the /views/stores folder there and
the file is where it’s supposedly looking. I can’t fathom what the issue
is here. Any help?
Try renaming cities.rjs to cities.js.rjs. Rails is smart enough to know
that it’s getting a JS request, so there’s no need to tell Rails to what
template to use as long as the controller method and view template
follow
the standard naming convention.
Tim
On Tue, Sep 22, 2009 at 5:36 PM, bill walton [email protected]
wrote:
end
Pretty sure this will pick up the .rjs template.
HTH,
Bill
–
Tim L.
Coroutine LLC
516 Tennessee St., Suite 215
Memphis, TN 38103
office: 901.312.8818
mobile: 901.490.5325 http://www.coroutine.com
Hi again,
Bah, turns out I had the right files in the wrong folder. I have an
admin/stores folder and a plain old stores folder, and my partials and
RJS were in the admin version Stupid!
Thanks,
Aaron.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.