bay6 / books-share

图书分享
5 stars 7 forks source link

ActionView::Template::Error (undefined method `type' for nil:NilClass): #96

Closed songjiayang closed 11 years ago

songjiayang commented 11 years ago

some details

ActionView::Template::Error (undefined method `type' for nil:NilClass):
    76:               td= number_to_human_size resource.try(:attachment).try(:file_size)
    77:               td= link_to t("helpers.links.hyperlink"), resource.download_link, class: "btn btn-mini btn-success", target: "_blank"
    78:               / - if resource.transformed
    79:               td= link_to t('helpers.links.read'), read_resource_path(resource), class: "btn btn-info btn-mini", target: "_blank" if resource.can_read_online?
    80:               / - else
    81:               /   td= link_to t('helpers.links.transform'), pdf2html_resource_path(resource), method: :put, class: "btn btn-danger btn-mini", data: { confirm: t('helpers.links.confirm') } if can? :pdf2html, resource
    82:               td= link_to '×'.html_safe, resource, method: :delete, data: { confirm: t('helpers.links.confirm') }, remote: true, :class => 'close' if can? :destroy, resource

maybe this line code https://github.com/caok/books-share/blob/master/app/models/resource.rb#L38

songjiayang commented 11 years ago

已修复。。可以关闭 9dab42026da66ef8f0f0b98f5e348b19130f5855