Skip to content

Added ability to use modules in searchable method #26

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

Closed
wants to merge 1 commit into from

Conversation

LaurensN
Copy link

This PR gives you the ability to reference Models from Rails Engines / Modules.

For example:

def searchable_columns
# list columns inside the Array in string dot notation.
# Example: 'users.email'
@searchable_columns ||= [
"module_or_engine_name/model_name.column_name",
]
end

The sortable method seems to work fine using the normal notation (module_or_engine_name_model_name.column_name)

@antillas21
Copy link
Collaborator

@LaurensN could you share a test for this code?

@antillas21
Copy link
Collaborator

@LaurensN it's been a while since this PR has been open... we've finally come to grips on how we would like to define searchable and sortable columns. Please take a look at our proposed changes for this feature here: https://github.com/antillas21/ajax-datatables-rails/tree/version-0-3-0#searchable-and-sortable-columns-syntax

The methods that make this possible:

We would like to hear any feedback you can provide 😄

@antillas21 antillas21 closed this Dec 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants