Severity: Notice
Message: Trying to access array offset on value of type bool
Filename: view/view.php
Line Number: 33
Severity: Notice
Message: Trying to access array offset on value of type bool
Filename: view/view.php
Line Number: 33
Severity: Notice
Message: Trying to access array offset on value of type bool
Filename: view/view.php
Line Number: 33
## lib/Jizzy/Controller/Categories.pm sub edit { # Fetch the category id from the parameters my $id = $self->param('id'); # Get information from the database about the category my $result = $self->db->resultset('Category')->find($id); $self->param('parent_id', $result->parent_id) unless $self->param('parent_id'); # Add information in the stash for the template (e.g. edit.html.ep) $self->stash(id => $result->id); # Render the template $self->render; } ## templates/categories/edit.html.ep % layout 'admin' % title => 'Jizzy.eu: Edycja Kategorii'; <h2>Category Edit [<%= stash 'id' %>]</h2> %= form_for 'update_category' => (method => 'POST') => begin %= include '/categories/_form' <nav class="is-flex"> %= link_to "Back" => "/categories", class => 'button', style => "flex:1" %= submit_button 'Update', class => 'button is-primary', style => "flex:1" </nav> % end ### templates/categories/_form.html.ep <table class="table is-striped is-fullwidth"> <tr> <th><%= label_for parent_id => 'Parent:' %></th> % my $options = category_select <td> %= select_field parent_id => $options, class => 'input' </td> </tr> </table>