Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 855569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:05:45+00:00 2026-05-15T08:05:45+00:00

In my app I am using the ym4r-gm plugin, which allows you to play

  • 0

In my app I am using the ym4r-gm plugin, which allows you to play with the Google Maps API… I put the map “setup” in the controller:

@map = GMap.new("div_map")
@map.control_init(:large_map => true, :map_type => true)
@map.center_zoom_init([47.0, 26.0], 7)
...

And only render @map in the view.

So my first question is whether I am using the right approach of “diving” this code?
And the second question is: I have to models, which are rendering the same map (only the resources are different). Where should I put my refactored method that renders the map? In the application controller, maybe?

Thanks in advance,
I hope you will understand me!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:05:46+00:00Added an answer on May 15, 2026 at 8:05 am

    Depending on the size of you project. You could add it to the application controller, in case you want other controllers to take advantage of it. Or you could create a new module and put your code in there, this way you will need to include it into models/controllers that need it only.

    I’d prefer the latter, since it is more structured that way and application controller is not cluttered. But this is really a personal choice.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an app using the Facebook C# API. I want to read
I'm building an app using Windows Azure Table. I've encapsulated all my calls to
I have a basic app using the ASP.NET membership provider. By default, you can
I'm developing an app using a fork of LeavesViewController that changes to a two-page
I am developing an app using Grails and GWT for a client side. I
I have a console app using log4net (via Castle Windsor). Everything logs fine to
I have a winforms app using a trackbar. The BackColor property is available for
I've got an app using CoreData as a data storage mechanism and the app
I am writing an app using WPF 3.5 and I need twitter integration. I
I wrote a php app using php+smarty. When I view the web source code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.