Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Resource generator shouldn't generate pointers #198

Closed
markbates opened this issue Jan 30, 2017 · 0 comments
Closed

Resource generator shouldn't generate pointers #198

markbates opened this issue Jan 30, 2017 · 0 comments
Labels
enhancement New feature or request

Comments

@markbates
Copy link
Member

Currently the resource generator generates the interface on a pointer type, this is unnecessary, it should be a value type:

type TodosResource struct {
	buffalo.Resource
}

// List default implementation.
func (v TodosResource) List(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#List"))
}

// Show default implementation.
func (v TodosResource) Show(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#Show"))
}

// New default implementation.
func (v TodosResource) New(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#New"))
}

// Create default implementation.
func (v TodosResource) Create(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#Create"))
}

// Edit default implementation.
func (v TodosResource) Edit(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#Edit"))
}

// Update default implementation.
func (v TodosResource) Update(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#Update"))
}

// Destroy default implementation.
func (v TodosResource) Destroy(c buffalo.Context) error {
	return c.Render(200, r.String("Todos#Destroy"))
}
@bscott bscott added the enhancement New feature or request label Jan 31, 2017
markbates added a commit that referenced this issue Feb 1, 2017
[#198] moving resource generator to avoid pointers
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants