Mongoid error

23 views
Skip to first unread message

Cristiano de Araujo Bezerra

unread,
Jun 8, 2015, 4:36:32 PM6/8/15
to rubyonra...@googlegroups.com


i need to create a document to see my app running


this code (products/index) generates the error:


<td><%= link_to Category.find(product.category_id).name, category_path(product.category_id) %></td>


folow the code:

https://github.com/webofbits/ninjastore




Colin Law

unread,
Jun 8, 2015, 4:51:26 PM6/8/15
to rubyonra...@googlegroups.com
On 8 June 2015 at 21:30, Cristiano de Araujo Bezerra
<webo...@gmail.com> wrote:
> ...
> this code (products/index) generates the error:
>
> <td><%= link_to Category.find(product.category_id).name, category_path(product.category_id) %></td>

You have told us it generates an error, but not what the error is.
Please copy/paste the full text of the error here (from the server
window).

By the way, it would be better to use product.category rather than
Category.find(product.category_id).

Colin

Cristiano de Araujo Bezerra

unread,
Jun 8, 2015, 9:27:53 PM6/8/15
to rubyonra...@googlegroups.com
i think is not a question of error but a question of what should i do to get the right way. i am tottaly newbie. all that i know is when i clone my app in other computer
i get this message. i'd like to know if i can avoid this message. in the image the red text tells me what to do but where i can edit i have no idea.

Cristiano de Araujo Bezerra

unread,
Jun 8, 2015, 9:29:11 PM6/8/15
to rubyonra...@googlegroups.com
i don't know to to se the Mongoid.raise_not_found_error config option to false

Cristiano de Araujo Bezerra

unread,
Jun 8, 2015, 9:32:28 PM6/8/15
to rubyonra...@googlegroups.com

this is my app running in my personal computer. the category is a link. when i click on it the app takes me to another paage showing all the products related with this categories.

Cristiano de Araujo Bezerra

unread,
Jun 8, 2015, 10:50:25 PM6/8/15
to rubyonra...@googlegroups.com

when i use just product.category it just show this:

Colin Law

unread,
Jun 9, 2015, 3:46:26 AM6/9/15
to rubyonra...@googlegroups.com
On 9 June 2015 at 02:27, Cristiano de Araujo Bezerra
<webo...@gmail.com> wrote:
> i think is not a question of error but a question of what should i do to get
> the right way. i am tottaly newbie. all that i know is when i clone my app
> in other computer
> i get this message. i'd like to know if i can avoid this message. in the
> image the red text tells me what to do but where i can edit i have no idea.

I suggest that you start by working right through a good tutorial such
as railstutorial.org (which is free to use online). That will show
you the basics of rails so you should then be able to get going with
the cloned app.

There is no way that we can lead you one tiny step at a time to get it going.

Colin

Cristiano de Araujo Bezerra

unread,
Jun 9, 2015, 3:26:31 PM6/9/15
to rubyonra...@googlegroups.com
ok thanks.
i think i solved my problem using: product.catergoy.name
Reply all
Reply to author
Forward
0 new messages