Thursday, June 6, 2024
24
rated 0 times [  25] [ 1]  / answers: 1 / hits: 52321  / 14 Years ago, sun, may 2, 2010, 12:00:00

Using rails3 - I have a project with many tasks. I want to use javascript to build the UI for each task. I figured I could display those tasks on the projects show page by rendering a javascript partial for each. I can't get 'tasks/show' to see tasks/show.js.erb Any ideas?



In projects/show.html.erb



<div id=tasks>
<%= render(:partial => tasks/show, :collection => @project.tasks) %>
</div>


tasks/show.js.erb



$(tasks).append(new TaskWidget(task.id))


I get the errors



ActionView::MissingTemplate in Projects#show 

Missing partial tasks/show with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in view paths .... around line #13


Thanks


More From » ruby-on-rails

 Answers
7

Shouldn't it be in the file _show.js.erb?



From Using Partials.


[#96902] Thursday, April 29, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
blaynetheoi

Total Points: 146
Total Questions: 116
Total Answers: 103

Location: India
Member since Thu, Apr 8, 2021
3 Years ago
;