I actually did not rename it to default.js, but when I try to do that
and access localhost I get an error:
ExecJS::ProgramError in People#index
Showing: /app/views/layouts/application.html.erb where line #6 raised:
TypeError: Object doesn't support this property or method
and line 6 which is:
<%= javascript_include_tag 'default', 'data-turbolinks-track' => true %>
I tried using scaffold and it does the same thing, it can add, but it
does not delete, it directs me to /posts/1 where it just displays the
data for id:1
The code in views is different from mine:
index:
<td><%= link_to 'Destroy', post, method: :delete, data: { confirm: 'Are
you sure?' } %></td>
controller:
def destroy
@post.destroy
respond_to do |format|
format.html { redirect_to posts_url, notice: 'Post was
successfully destroyed.' }
format.json { head :no_content }
end
end
--
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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/460fe4de0315f223782195ada5312029%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment