# Render - Missing Template

**URL:** <https://www.ruby-forum.com/t/render-missing-template/184350>\
**Category:** Rails\
**Created:** [March 1, 2010, 11:14am UTC](https://www.ruby-forum.com/t/render-missing-template/184350 "2010-03-01T11:14:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daryn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a87d85/32.png) [@Daryn](https://www.ruby-forum.com/u/Daryn)\
**Post date:** [March 1, 2010, 11:14am UTC](https://www.ruby-forum.com/t/render-missing-template/184350/1 "2010-03-01T11:14:47Z")

</div>

Sorry if you have had this problem many times before. I just can’t  
seem to find the problem.

I have a budget controller with a create action like this:

def create

```
# do some things

if budget.save
  redirect_to(period_budgets_path(period))
else
  @budget = budget
  @expense = budget.expense
  @period = budget.period
  render :action => "new"
end

```

end

When I try to save an invalid budget, I get a missing template error.  
Sorry, I don’t have the exact message with me now but it basically  
says ‘missing template new.erb’.

I do have a new.html.erb so I am not sure what is going wrong.

If I use  
render :template =\> “budgets/new.html.erb”

That kind of works, but I get a strange URL of:  
[http://localhost:3000/periods/1/budgets.%23](http://localhost:3000/periods/1/budgets.%23)budget:0xb719b18c

Why is render :action =\> “new” not working in my case?

Again, I am sorry if this group has been inundated with similar  
questions, I am just completely stuck!

Thank you!

---

<div class="post-metadata">

**Author:** ![Daryn](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/a87d85/32.png) [@Daryn](https://www.ruby-forum.com/u/Daryn)\
**Post date:** [March 1, 2010, 11:33am UTC](https://www.ruby-forum.com/t/render-missing-template/184350/2 "2010-03-01T11:33:31Z")

</div>

On Mar 1, 10:13 am, Daryn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> render :template =\> “budgets/new.html.erb”
> 
> That kind of works, but I get a strange URL of:[http://localhost:3000/periods/1/budgets.%23](http://localhost:3000/periods/1/budgets.%23)budget:0xb719b18c

I think this is actually the route of the problem - the post is going  
to this url, which rails is interpreting as someone requesting a  
document with a non html format.

What does your form look like ?

Fred
