-
Notifications
You must be signed in to change notification settings - Fork 80
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
Pagination error "paginate_products/1 is undefined or private." #163
Comments
You'd have to describe which commands you ran first. What generator commands did you run to generate the torch files? Also, which version of Torch and Phoenix are you using? |
I am using Phoenix 1.4 and torch 3.1. I followed the Installation guide.
Later I added to my router.ex:
and to endpoint.ex
|
I see. So, by passing the You'd either need to manually add this method in, or you can run the generator again without the When using the Or, a final alternative would be to use a new context for the admin side of things vs re-using the existing context you had in place. |
I ran same generator again without the --no-context and added paginate_product. Copied and pasted paginate_products and other methods on top of inventory.ex. Now it raises such error:
My inventory.ex:
I am sorry for raising the issue by probably newbie mistakes... |
Sure, see how many of the functions are duplicated now? For example, you already had/have a But, when you copy/pasted the generated code you pasted everything including the stubbed functions:
You'll want to remove these duplicated functions that you pasted at the top and keep the functions that you already had defined. Really, you just wanted to paste in the functions that didnt already exist in your file previously. Namely, the following:
Note that, since you ran the generator with
and:
|
1. Run: mix torch.gen.html Blog Post posts --no-schema --no-context --web Admin title:string body:text published_at:datetime published:boolean views:integer slug:string 2. See: mojotech/torch#163 (comment) 3. See: mojotech/torch#100 (comment)
I am fairly new to Elixir and Phoenix. I followed the instructions, but I cannot access the "/admin/products" page because of the error:
I don't know where to start with solving this problem. Does anyone have an idea what is wrong or what I could have done wrong?
The text was updated successfully, but these errors were encountered: