# Template is missing

**URL:** <https://www.ruby-forum.com/t/template-is-missing/173767>\
**Category:** Rails\
**Created:** [August 14, 2009, 11:17am UTC](https://www.ruby-forum.com/t/template-is-missing/173767 "2009-08-14T11:17:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![elioncho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ed8c4c/32.png) [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Post date:** [August 14, 2009, 11:17am UTC](https://www.ruby-forum.com/t/template-is-missing/173767/1 "2009-08-14T11:17:43Z")

</div>

Ok I’m getting this weird error whenever the update action fails to  
update. My code is below (its pretty straightforward). When the update  
is successful it works well, the problem is when it fails. I get a,

Template is missing  
Missing template accounts/edit.erb in view path app/views

This doesn’t makes any sense as the edit view opens when I want to  
edit my account in the first place. I have noticed this on my console  
which seems weird and I’m pretty sure has to do with the problem:

Processing AccountsController#update to #account:0xb70a69ac (for  
127.0.0.1 at 2009-08-14 04:04:28) [PUT]  
Parameters: {“format”=\>“#account:0xb70a69ac”… —\> NOTICE THE  
‘update to’ , the account:0x...ac and the format parameter.

And the url changes to this:

[http://antonio.app.com:3000/account.%23](http://antonio.app.com:3000/account.%23) … 70a69ac%3E

Any ideas?

def edit  
@account = current\_account  
end

def update  
@account = current\_account  
if @account.update\_attributes(params[:account])  
flash[:notice] = t(‘flash.saved’)  
redirect\_to :action =\> :show  
else  
render :action =\> :edit  
end  
end

---

<div class="post-metadata">

**Author:** ![elioncho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ed8c4c/32.png) [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Post date:** [August 14, 2009, 5:41pm UTC](https://www.ruby-forum.com/t/template-is-missing/173767/2 "2009-08-14T17:41:07Z")

</div>

Yep, I tried that and I’m still getting the same error.

On Aug 14, 4:39 am, Rails L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![elioncho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ed8c4c/32.png) [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Post date:** [August 14, 2009, 11:39am UTC](https://www.ruby-forum.com/t/template-is-missing/173767/3 "2009-08-14T11:39:57Z")

</div>

specify the controller name in your render and redirect. Is it still  
giving the same error?

---

<div class="post-metadata">

**Author:** ![elioncho](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/ed8c4c/32.png) [@elioncho](https://www.ruby-forum.com/u/elioncho)\
**Post date:** [August 14, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/template-is-missing/173767/4 "2009-08-14T17:59:16Z")

</div>

Fixed it. I was using a form\_for like this:

\<% form\_for @account do |f| %\>

and this was generating the following in html:

\<form action="/account.%23%3Caccount:0xb71052a4%3E" class="edit\_account"...

Maybe because it is a resource?

I changed it to:

\<% form\_for :account, @account, :url =\> { :action =\> ‘update’ }, :html  
=\> { :method =\> :put } do |f| %\>

Now it works!
