Hi Sergio, Thanks, but this is not working for me. I can get only field_search or search to work, but not both, using separate links, or the swap. I decided I would try to build a fresh application, so there would be no ambiguity about the test case, and thought it would also be good to document this somewhere. I was able to get the application to build, but not function properly. I think you need to update the bundle exec *rails g active_scaffold:install to work with latest rails stack, which has rearranged the asset folder. *Here are the steps I followed to build the test application on my mac.
*Rails6 ActiveScaffoldProjectSetup* *git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask fetch --unshallow* *brew update* *brew install node* *brew install yarn* *brew install rbenv* *rbenv install 2.7.1* *gem install bundler* * Successfully installed bundler-2.2.11* *gem install rails -v 6.0.3.5* *# Installing mysql2 gem with macOS Mojave and Brew* *gem install mysql2 -v '0.5.3' -- \* *--with-mysql-config /usr/local/Cellar/[email protected]/5.7.29/bin/mysql_config \* *--with-cppflags=-I/usr/local/opt/[email protected]/include \* *--with-ldflags=-L/usr/local/opt/[email protected]/lib* * mkdir rails6app* * cd rails6app/* *#bundler using old version* *gem update --system* *#create the new Rails app* *rails _6.0.3.5_ new myapp -d mysql* *cd myapp* *#Add to Gemfile* *gem 'active_scaffold', '3.6.0.rc2'* *gem 'jquery-rails'* *gem 'jquery' #Used by active_scaffold* *#run Bundle install* *bundle install* *#create app/assets/javascripts/application.js, and add these lines* *#The new architecture has moved the javascript folder and renamed it!* *//= require jquery* *//= require jquery_ujs* *//= require_tree .* *//= require active_scaffold* *#Setup your rails app for Active Scaffold* *bundle exec rails g active_scaffold:install * *#Create the database* *bundle exec rails db:create* *#Create a resource* *rails g active_scaffold:resource vehicle m_id:integer chassis:string type:string yr_made:string yr_ended:string doors:string drive_train:string e_mnt:string hp:integer trq:integer e_id:integer trans:string* *#Run the migration created to build the new resource* *bundle exec rails db:migrate* *#start the app* *bundle exec rails s* *#navigate to Resource* *http://localhost:3000/vehicles* On Monday, February 22, 2021 at 4:34:27 AM UTC-6 [email protected] wrote: > Hi > > This is how I did in the past, it's in a project I haven't upgraded to > master yet, but I think it should still work: > > > config.actions << :field_search > > > config.field_search.link.parameters = {:kind => :field_search} > > Regards > > El domingo, 21 de febrero de 2021 6:14:53 (CET) Dennis Bulgatz escribió: > > > Can you confirm that search/field_search swap is working in current > master, > > > or 3.6.0 rc2 ? I can only get search or field search to work, not both, > > > and no "swap" behavior. > > > > > > If you have a working controller example, could you post it? > > > > > > Thanks! > > > > > > On Thursday, December 10, 2020 at 10:37:41 AM UTC-6 [email protected] > wrote: > > > > Hi > > > > > > > > This works like a charm, thanky you very much. > > > > > > > > Regards, Jan > > > > > > > > [email protected] schrieb am Freitag, 4. Dezember 2020 um 11:28:28 > UTC+1: > > > >> El jueves, 3 de diciembre de 2020 15:48:53 (CET) [email protected] > > > >> > > > >> escribió: > > > >> > Hi > > > >> > > > > >> > Is it possible to add an action/button/whatever to let my users > toggle > > > >> > between seach and field search in an List? > > > >> > > > > >> > Regards, Jan > > > >> > > > >> Hi > > > >> > > > >> By default, you must choose if you want to use search or field search > > > >> actions, > > > >> swapping search with field_search action (config.actions.swap :search, > > > >> > > > >> :field_search), or leaving default search action. > > > >> > > > >> If you add field_search action, instead of swapping search, it will > add > > > >> action_link to show search with same parameters as search's action > link, > > > >> which > > > >> will open form for search action. You can define kind parameter of the > > > >> field_search's action_link: > > > >> > > > >> config.field_search.link.parameters = {:kind => :field_search} > > > >> > > > >> In this way, you will get 2 show search links, so you may want to > change > > > >> some > > > >> labels too. > > > >> > > > >> Regards > > > -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails Gem" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/activescaffold/cc462398-711e-4777-9869-74c02851535bn%40googlegroups.com.
