I'm trying to implement Swiftype on Rails 3.2.5. However, when adding a category, and running rake jobs:work
, I get the following error message:
CreateSwiftypeDocumentJob failed with NoMethodError: undefined method `post_url' for #
In the CreateSwiftypeDocumentJob
model I have :
post = ProposalCategory.find(proposal_category_id)
url = Rails.application.routes.url_helpers.post_url(post)
If somebody could please help with this, that'd be much appreciated.
post_url
should only be used if you actually have a route for the Post resource.What is in your
routes.rb
file? Presumably something like:In that case, you would need to use a route like
proposal_category_url
.