Hi I want to preface this by saying that I am new to coding.
I have an issue that I believe can be solved in two ways
A. by rendering a partial
B. by updating the controller
( I can totally be wrong but these are what I suspect lol)
I have two controllers/views "reviews" and "logs". and I want them to both appear on the same page.
How can I do this? I tried rendering a partial but I alway get an error.
and I tried the piece of code below:
which made my reviews show up on the page, but when I add
@log = @user.logs.all
to it, it doesn't pull all the logs to the page like it does for the reviews.
def show
@user = User.find_by_name(params[:id])
if @user
@reviews = @user.reviews.all
render action: :show
else
render file: 'public/404', status: 404, formats: [html]
end
end