Comments (3)
Pass self
into the no_results_html
:
grid.no_results_html(self)
from datagrid.
For posterity, I'll note that this appears to be something like a view context, and on it are all the helper methods I would expect and hope for:
def no_results_html(view_context)
view_context.link_to ....
end
from datagrid.
Yes, it is. I just found there is another way:
class Grid
include Rails.application.routes.url_helper
def no_results_html
helpers = ApplicationController.helpers
helpers.content_tag(:div, "No Results") + helpers.link_to("Back", root_path)
end
end
Up to you....
https://stackoverflow.com/questions/4112050/how-to-use-all-view-and-helper-methods-inside-of-rails-console-for-rails-2-x-and
https://stackoverflow.com/questions/2846247/rails-check-output-of-path-helper-from-console
from datagrid.
Related Issues (20)
- How to filter data for an attribute that is not part of the Datagrid object? HOT 2
- Unable to change column position unless the model grid file is updated HOT 6
- Ability to set data attributes for from and to in a range HOT 7
- add header to filter type enum or xboolean HOT 2
- Rails 7 support? HOT 2
- Custom driver HOT 4
- Receiving a 302 error when searching HOT 4
- UI without HTML Table element HOT 2
- Cannot use Sequel pagination HOT 14
- Multiple rows per asset HOT 12
- Order error with batches HOT 4
- Demo link in README is broken HOT 1
- Optimizing Single Authorization Check HOT 2
- Unable to set class attribute for select filter HOT 2
- User's current time zone HOT 3
- Ability to define partials for additional filter types HOT 8
- Or filter HOT 2
- Ability to set filter value programmatically
- HTMLs for range filters don't conform to the HTML standards
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 datagrid.