Hi Guys,

I got a missing template error when I tried to achieve a task using RJS.

All I want is to execute an RJS file on ajax call. But I am getting the
following error.


ActionView::MissingTemplate (Missing template line_items/create,
application/create with {:handlers=>[:erb, :builder, :coffee],
:formats=>[:js, :html], :locale=>[:en, :en]}. Searched in:
* "<MY APP PATH>/app/views"
):
app/controllers/line_items_controller.rb:46:in `create'


But the create.js.rjs is present in the folder /views/line_items. You
can see the handlers miss .rjs extension. I think thats causing the
error.

If I change .rjs to .erb, it works and the content is executed as
javascript and thus I need to modify the RJS functions to Javascript to
return the contents of AJAX call.

Could you please explain how I can attain this using RJS? Please help.

Following is the versions of tools I use.

Ruby version 1.9.2 (i686-linux)
RubyGems version 1.8.10
Rack version 1.3
Rails version 3.1.0
JavaScript Runtime Node.js (V8)
Active Record version 3.1.0
Action Pack version 3.1.0
Active Resource version 3.1.0
Action Mailer version 3.1.0
Active Support version 3.1.0


Thanks in advance.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Search Discussions

  • Ad at Oct 3, 2011 at 5:06 pm
    RJS was stripped out from 3.1.
    See http://weblog.rubyonrails.org/2011/4/21/jquery-new-default for
    details.

    You may also try the following code from the author of RightJS
    library:
    https://gist.github.com/1200232
    It should work with jQuery.
    On Oct 3, 9:59 am, Jithin Syam wrote:
    Hi Guys,

    I got a missing template error when I tried to achieve a task using RJS.

    All I want is to execute an RJS file on ajax call. But I am getting the
    following error.
    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
  • Jithin Syam at Oct 5, 2011 at 5:29 am
    Yup, thats the answer. But I couldn't make it working with the RightJS
    library(the template message error changed to a update_path method
    missing error).

    Anyway I have fallback to the jQuery method. Thanks for the help.

    ad wrote in post #1024807:
    RJS was stripped out from 3.1.
    See http://weblog.rubyonrails.org/2011/4/21/jquery-new-default for
    details.

    You may also try the following code from the author of RightJS
    library:
    https://gist.github.com/1200232
    It should work with jQuery.
    --
    Posted via http://www.ruby-forum.com/.

    --
    You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
    To post to this group, send email to rubyonrails-talk@googlegroups.com.
    To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedOct 3, '11 at 5:59a
activeOct 5, '11 at 5:29a
posts3
users2
websiterubyonrails.org
irc#RubyOnRails

2 users in discussion

Jithin Syam: 2 posts Ad: 1 post

People

Translate

site design / logo © 2021 Grokbase