Skip to content

Instantly share code, notes, and snippets.

@malgorath
malgorath / web.php
Created March 21, 2017 14:28
This right?
<?php
Route::group(['prefix' => 'ead'], function () {
Route::resource('', 'ead\EadProjectController');
Route::resource('/{ead}/parts', 'ead\EadPartController');
Route::group(['prefix' => 'admin'], function () {
Route::get('/', 'ead\EadProjectController@admin');
Route::resource('msl', 'EadMSLCodeController');
Route::resource('placement', 'EadPartPlacementController');
Route::resource('category', 'EadPartCategoryController');
});
ArgumentError in MasterLists#create
Showing /Projects/rails_projects/ProcessSteps/app/views/master_lists/_form.html.erb where line #1 raised:
First argument in form cannot contain nil or be empty
Extracted source (around line #1):
1
2
3
4
5
@malgorath
malgorath / web.php
Created September 16, 2016 16:48
Continually Wraps to login
Route::group(['middleware' => 'auth'], function () {
Route::get('/', 'CategoriesController@index');
Route::resource('categories', 'CategoriesController');
Route::resource('categories.links', 'LinksController');
Route::bind('categories', function($value, $route) {
return App\Categories::whereSlug($value)->first();
});
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Category extends Model
{
public function links()
{
@malgorath
malgorath / Full Trace.txt
Last active July 27, 2016 02:53
ActiveRecord::AssociationTypeMismatch in TaskListsController#create ProcessStepsCategory(#47262720562860) expected, got String(#47262609621080)
ActiveRecord::AssociationTypeMismatch in TaskListsController#create
ProcessStepsCategory(#47262720562860) expected, got String(#47262609621080)
Extracted source (around line #47):
45
46
47
48
49
50
@malgorath
malgorath / Rakefile
Last active May 26, 2016 13:47
Trying to add bin/rails to an open_project:plugin generated engine
begin
require 'bundler/setup'
rescue LoadError
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
end
require 'rdoc/task'
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
@malgorath
malgorath / index.html
Created May 10, 2016 19:06
Openproject "plugin" I am attempting to create for the first time. Line 13 is where I would like the current project_id from the session variable to print but its not working that way.
<%
p_id = nil
wp_id = nil
%>
<div class="page-header">
<a href="/" class="btn btn-default pull-right">&lt;&lt; Return to OpenProject</a>
<h1 class="">Todo Tasks List</h1>
</div>
<% if notice %>
<div class="well well-danger"><%= notice %></div>
NameError in OpenprojectTodolist::Todolists#index
Showing /home/ssanders/RubymineProjects/plugins/openproject_todolist/app/views/openproject_todolist/todolists/index.html.erb where line #24 raised:
undefined local variable or method `project_id' for #<#<Class:0x0000000708b478>:0x00000006be3218>
Did you mean? object_id
project_tree
project_nested_ul
project_settings_tabs
proc
project_path_or_url
Environment:
Request Method: POST
Request URL: http://localhost:8000/ldapper/login/
Django Version: 1.9.5
Python Version: 2.7.11
Installed Applications:
['django.contrib.admin',
{% if links %}
{% regroup links by links.linkgroup as link_list %}
{% for l in link_list %}
<li>
<h4>{{ l.grouper }}</h4>
<ul>
{% for i in l.linkgroup %}
<li>{{ i.title }}</li>
{% endfor %}
</ul>