How do I call a Grails service from a gsp?

Best to use the tag library because creating a service instance directly in the view via the class loader WILL NOT autowire other services declared that may live in the service you are trying to use. Using the tag library you will have auto-wiring of those services. In your gsp view <g:customTag param1=”$modelObjec” param2=”someString” /> … Read more

SwiftUI – Change TabBar Icon Color

Solution 1 Use renderingMode(.template) struct MainView: View { var body: some View { TabView { LoginView().tabItem { VStack { Text(“Login”) Image(“login”).renderingMode(.template) } } HomeView().tabItem { VStack { Text(“Home”) Image(“home”).renderingMode(.template) } } }.accentColor(.orange) } } Solution 2 Make tabItem type enum TabViewItemType: String { case login = “login” case home = “home” case search = “search” … Read more

Show the CREATE VIEW code for a view in PostgreSQL?

Kept having to return here to look up pg_get_viewdef (how to remember that!!), so searched for a more memorable command… and got it: \d+ viewname You can see similar sorts of commands by typing \? at the pgsql command line. Bonus tip: The emacs command sql-postgres makes pgsql a lot more pleasant (edit, copy, paste, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)