Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin interface always states: "No Snippet Files" #5

Open
janhoffmann opened this issue Sep 6, 2013 · 0 comments
Open

Admin interface always states: "No Snippet Files" #5

janhoffmann opened this issue Sep 6, 2013 · 0 comments

Comments

@janhoffmann
Copy link

hey,

this might be a bug, but I would appreciate your feedback.

System:
radiant-1.1.1
radiant-snippets-extension-1.1.2
(plus some other extensions)
on Rails 2.3.16 with ruby 1.9.3p0 (<-yeah, I know...)

I created a emtpy file at root: app/templates/snippets/blah.radius
In rails console:

>> SnippetFile.all
=> [#<struct SnippetFile name="blah", content="">]

So it seems to work here. opening the admin interface results in getting the "No Snippet Files"-message.

I looked in the view and found the check for: @snippet_files.present?
But havn't found the controller to set @snippet_files. I tried to correct that by adding a index action and @snippet_files = SnippetFile.all to the action, but than i result in a 500-error:

Rendering admin/snippet_files/index
ActionView::TemplateError (undefined method `id' for #<struct SnippetFile name="blah", content="">) on line #15 of /[....]/gems/radiant-snippets-extension-1.1.2/app/views/admin/snippet_files/index.html.haml:
12:       - if @snippet_files.present?
13:         - @snippet_files.each do |snippet|
14:           %tr[snippet]
15:             - render_region :tbody, :locals => {:snippet => snippet} do |tbody|
16:               - tbody.title_cell do
17:                 %td.name
18:                   = link_to image('snippet', :alt => '') + ' ' + snippet.name, admin_snippet_file_url(snippet)

Thanks for your comments!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant