Skip to content
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

Render Hashtag Error Rails 4 #14

Open
RailsCod3rFuture opened this issue Jul 8, 2015 · 2 comments
Open

Render Hashtag Error Rails 4 #14

RailsCod3rFuture opened this issue Jul 8, 2015 · 2 comments

Comments

@RailsCod3rFuture
Copy link

Getting Missing partial posts/_post with {:locale=>[:en], :formats=>[:html], :variants=>[], :handlers=>[:erb, :builder, :raw, :ruby, :coffee, :slim, :haml, :jbuilder]}. Searched in: When I click on hashtag

def render_hashtaggable(hashtaggable)
klass = hashtaggable.class.to_s.underscore
view_dirname = klass.pluralize
partial = klass
render "#{view_dirname}/#{partial}", {klass.to_sym => hashtaggable}
end
end

render "#{view_dirname}/#{partial}", {klass.to_sym => hashtaggable} is the line that's searching for the missing partial _post.

Maybe, you can look into this error to see why redirecting to the hashtags show views aren't working properly.

@RailsCod3rFuture
Copy link
Author

I created a makeshift _post view that was empty to bypass the error.

@RailsCod3rFuture
Copy link
Author

It's looking inside of the partial, only to find the user object, but it's not rendering without the ID of the user. Fix?
ActionView::Template::Error (undefined method `user' for nil:NilClass):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant