Comments (7)
Hello,
Are you sure following is included in your controller?
include SmartListing::Helper::ControllerExtensions
helper SmartListing::Helper
from smart_listing.
I'm including these lines in the application_controller.rb
. I tried in the specific controller too and still got the error.
Since I'm just trying it in a new app, it's not hassle to start over, so I'll go to do that tomorrow and watch carefully all my steps and see for sure if I'm not doing something wrong. I'm closing this issue for now until I got sure if it's me or not. If can't figure it out I'll post every step and the app to reproduce the error too. I'm in the latest Rails 4.1.1 by the way, if that matters.
It's a wonderful gem and really handy I hope I can use it because I have a use case that it just fits... Thank you for this nice gem and keep up with the good work!
from smart_listing.
So, I'm having a hard time trying to figure this out. I started from scratch and keeping having this error because of the <%= smart_listing_update :users %>
in the index.js.erb
.
I have this in the controller:
class UsersController < ApplicationController
include SmartListing::Helper::ControllerExtensions
helper SmartListing::Helper
def index
smart_listing_create :users, User.all, partial: "users/list"
end
end
I did everything else like the instructions. I'm for sure missing something. If I remove the call for <%= smart_listing_update :users %>
in the index.js.erb
the list works, but I'll be missing features. I've pushed an app to Github that shows the error in case you want to take a look. You can clone it from:
https://github.com/wsouto/smartlisting.git
I just initialized a new Rails app with rails 4.0.5 (I tried also and first with 4.1.1) and follow the steps on README here on Github.
Please, again, sorry if I'm doing something wrong but I just can't figure out... Any help will be thankfully apreciated and I'm really looking forward to use your gem.
Thanks in advance.
from smart_listing.
I looked at your code. First of all, add
//= require smart_listingto your application.js
and the most important, move index.js.erb from app/assets/javascripts to app/views/users.
from smart_listing.
Thank you very much @tolhaje !
So the move of index.js.erb
to app/views/users
did the trick.
I'm aware of the //= require smart_listing
, I just messed up too much with the app and removed it hoping for more errors messages that could give me more hints... Sorry about that.
Closing for good now.
from smart_listing.
I was getting same error on my application, I know that this is due to my lack of information, but, also documentation requires you have a prior knowledge about how Rails handle AJAX requests and responses. And I should, of course.
@wsouto I guess the reason why you need to move index.js.erb
is because this is like response of User#index
method when called with AJAX, so users_controller.rb
will look for a js file on views folder.
Am I right?
from smart_listing.
@wkurosawa You probabilly are. I just didn't have a clue that we could put js files in the views folder since we have all that asset pipeline and specific folder for javascript files... A simple note in the docs telling newbies like me about where to put this particular file could've helped a lot. But it's a newbie way to think. The name of the file itself is a clue, right?
from smart_listing.
Related Issues (20)
- Rails 5 Strong Parameters removes hash access for unpermitted params HOT 3
- Compatibility with rails 5.1 HOT 13
- be able to sort with an intance method of the class and not a column
- Prevent SQL Injection HOT 2
- Multiple params doesnt work after search HOT 1
- Update README regarding JS dependency HOT 1
- Pass locals params doesn't work HOT 1
- Rails 5.1 uses Webpack HOT 2
- Undefined local variable or method `smart_listing_resource' HOT 1
- Your site is down. HOT 1
- Elasticsearch with smart_listing
- Broken implicit sorting by join tables in v1.2.3 HOT 1
- Not all of the configured classes get applied?
- Replace kaminari with pagy
- The config editable class params should have side effect to broke gems
- Configured hidden class and popover_destroy command are not applied correctly
- needs to change pagination style
- "PG" Branch
- smart_listing.paginate broke with Ruby 3.1.1 HOT 3
- $(...).smart_listing is not a function HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from smart_listing.