Currently, as an app making, Ruby on Rails is making an app that buyers go to get based on the seller's address.
At that time, I would like to utilize the google map API and make the purchaser the center point of the initial map.
The seller and the buyer are creating different models using gem's devise.
I am using gem's geocoder to display the address on google map.
However, I am trying to register as a user using geocoder, but the value is not entered in the latitude/longitude column.
As a result, I can't decide the center point of the map. Since the address has been registered,
I want to put a value in: latitude,: longitude
I want to achieve
Get the user's latitude and longitude using gem's geocoder.
Since the address was created at the user registration stage, is it due to the controller?
In the first place, is the timing to acquire the latitude and longitude of geocoder different for new registration with devise?
app/models/exhibition.rb class Exhibition</pre> <pre><code>app/controllers/exhibitions/registrations_controller.rb class Exhibitions :: RegistrationsController<Devise :: RegistrationsController before_action: configure_sign_up_params, only: [: create] before_action: move_to_index protected def configure_sign_up_params devise_parameter_sanitizer.permit (: sign_up, keys: [: address,: city_number,: latitude,: longitude]) end
db/schema.rb create_table "exhibitions", options: "ENGINE = InnoDB DEFAULT CHARSET = utf8", force:: cascade do | t | t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "address", null: false t.string "city_number", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.datetime "created_at", precision: 6, null: false t.datetime "updated_at", precision: 6, null: false t.float "latitude" t.float "longitude" t.index ["email"], name: "index_exhibitions_on_email", unique: true t.index ["reset_password_token"], name: "index_exhibitions_on_reset_password_token", unique: true end
What I tried
I messed with the controller, but created it with devise and adjusted devise_parameter_sanitizer at the time of user registration etc.
Answer # 1
I solved it with reference to this.
- ruby - unable to access server with rails s
- ruby on rails - rails db registration activerecord :: associationtypemismatch in friendscontroller # create
- ruby on rails - unable to create controller
- ruby - unable to open rails server
- ruby - unable to create rails model (environment: cloud9)
- ruby - unable to save comments in db (rails)
- ruby - [rails] unable to resolve "name error in affiliates controller # show" error
- ruby on rails - unable to install direnv
- ruby on rails - unable to start server in aws production environment
- ruby - rails unable to resolve user errors
- ruby on rails - unable to access localhost with rails6 and docker
- ruby - [rails] implementation of sending registration completion email
- ruby on rails 6 - when i press new user registration, i get an error of no route matches [get] "/ users"
- ruby on rails - questions about routes
- ruby on rails - i want to resolve rails wrong number of arguments
- ruby - [rails] i want to create an image link using the url of the image output using active storage
- ruby - [rails] i want to find the date difference using the model created_at
- ruby on rails - i would like to add an automatic address input function to the new registration screen
- ruby on rails - [rails] i'm implementing a search function using form_with, but i'm having trouble with the search results not b
- ruby on rails - [rails] routing error occurs in devise_token_auth and the registration screen cannot be displayed
- ruby - please tell me the solution of rails devise (given 0, expected 1)!
- ruby on rails - about routing errors in devise
- ruby on rails - rails devise routing
- ruby - i want to call a partial template with the collection option so that the user detail page shows what the user posted
- ruby - rails5 array contains unintended backslashes
- ruby on rails - after installing devise on rails6, routing error occurs, so i want to eliminate it
- ruby - i want to prevent users other than the poster from transitioning to the page dedicated to the poster (rails)