0๐
Iโm not sure if it is your main issue but it looks your where clause is using single quotes, thus is not picking up that variable. You need to use double quotes if you want to use ruby string interpolation.
irb(main):006:0> foo = 5
=> 5
irb(main):007:0> 'this is my number #{foo}'
=> "this is my number \#{foo}"
irb(main):008:0> "this is my number #{foo}"
=> "this is my number 5"
So you want:
def self.search(search)
where('title LIKE ?', "%#{search}%")
end
- [Vuejs]-Authentication and Authorization in Elixir without Phoenix
- [Vuejs]-Javascript run function only once per button click
0๐
You should set the dataType
option to expect JSON data for the return value. You can do it like this:
$.ajax({
url: '/strains.json',
dataType: 'json',
success: function(res){
that.strains = res;
}
});
- [Vuejs]-Multiple returns in a computed property
- [Vuejs]-How to include folder name in vue router path
Source:stackexchange.com