|
07 Feb 2011, 23:08
Sergio Andrés Monsalve Castañeda
(2 posts)
|
I know that must be an stupid mistake but i can’t find it!!! please help here. :( sorry for my english and my nooby mistake
ActionView::Template::Error (Missing partial line_items/line_item with {:handlers=>[:rjs, :erb, :rhtml, :rxml, :builder], :locale=>[:en], :formats=>[:text]} in view paths "/Users/sergioandresmonsalvecastaneda/Dropbox/Programming/rails/depot/app/views"):
5:
6: <table>
7: <tr><th colspan="2">Qty</th><th>Description</th></tr>
8: <%= render @order.line_items %>
9: </table>
app/views/notifier/order_received.text.erb:8:in `_app_views_notifier_order_received_text_erb___178995583_2183281300_0'
app/mailers/notifier.rb:13:in `order_received'
app/controllers/orders_controller.rb:55:in `create'
app/controllers/orders_controller.rb:51:in `create'
Rendered /opt/local/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
Rendered /opt/local/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (11.7ms)
Rendered /opt/local/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (18.5ms)
|
|
08 Feb 2011, 13:42
Augusto Rodriguez
(9 posts)
|
Hi Sergio,
That code looks right for me, so maybe the actual partial file is missing.
Do you have the file /app/views/line_items/_line_item.text.erb ? And that file should have the following content:
<%= sprintf("%2d x %s",
line_item.quantity,
truncate(line_item.product.title, :length => 50)) %>
Cheers, a.
|
|
08 Feb 2011, 14:29
Sergio Andrés Monsalve Castañeda
(2 posts)
|
hey Augusto thanks for the reply.
well i just fixed my problem, but i didn’t figure out what happend there. i just made up everything again and this time worked. it’ll be a mistery to me.
and yes, that file was there and was good… i don’t really understand what went wrong.
|
|
08 Feb 2011, 15:33
Augusto Rodriguez
(9 posts)
|
I have to say that twice, while I was coding the examples, rails started to behave very oddly, it was like it wasn’t picking up the changes (I’m sure I saved the files) and after a few minutes or a server restart it would start working again. The changes didn’t include any configuration file, just an html.erb, model or controller.
I think it’s just a matter of timing it right and to know when to restart the server.
|
|
15 Feb 2011, 00:54
moon
(2 posts)
|
Hi
I had the same error at the h1 step. I copy paste the order_received view. And because of this line <%= render @order.line_items %> I have this error :
Missing partial line_items/line_item with {:locale=>[:en], :handlers=>[:rxml, :builder, :erb, :rjs, :rhtml], :formats=>[:text]} in view paths "/Users/spacemeli/Documents/projets/depot/app/views"
Everything was working before this step. Any ideas ?
Thanks a lot Melissa
|
|
15 Feb 2011, 00:58
moon
(2 posts)
|
Sorry this is the complete error :
ActionView::Template::Error (Missing partial line_items/line_item with {:locale=>[:en], :handlers=>[:rxml, :builder, :erb, :rjs, :rhtml], :formats=>[:text]} in view paths "/Users/moon/Documents/projets/depot/app/views"):
1: Dear <%= @order.name %>
2: Thank you for your recent order from The Pragmatic Store.
3: You ordered the following items: <%= render @order.line_items %>
4: We'll send you a separate e-mail when your order ships.
app/views/notifier/order_received.text.erb:3:in `_app_views_notifier_order_received_text_erb___2042847352_2175400340_0'
app/mailers/notifier.rb:12:in `order_received'
app/controllers/orders_controller.rb:55:in `create'
app/controllers/orders_controller.rb:51:in `create'
Rendered /Users/moon/.gem/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
Rendered /Users/moon/.gem/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (8.6ms)
Rendered /Users/moon/.gem/ruby/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (17.2ms)
|
|
27 Aug 2011, 02:15
George Ulmer
(1 post)
|
I was missing the partial too. It is called /app/views/line_items/_line_item.html.erb —(not .text.erb).
Thanks!
|
|
13 Jan 2012, 10:16
Teddy K. Nielsen
(3 posts)
|
I had the same error. The mistake I made was to name my partial view “_line_item.txt.erb” instead of the correct “_line_item.text.erb”. When I renamed the partial view to have the correct name, everything worked just fine.
|
|
17 Jul 2012, 11:48
Fernando Campos
(2 posts)
|
Thank you Teddy! That was my error also!
|
| |
You must be logged in to comment
|