Using many dynamic Google Maps on modals on the same page - Rails | Fixed issues |
- Using many dynamic Google Maps on modals on the same page - Rails
- Rails scopes with hash syntax
- Core php for multi-tenant application and recommended php framework which is compatible with php 5.3
- Can you define multiple actions with the same name in Rails?
- rake db:migrate error (Migrations are pending)
- Error when trying to use ruby gem- NameError (uninitialized constant RightScraper::Scraper)
- "undefined method `user' for nil:NilClass"
- passing jquery dattimepicker to sqlite database in Ruby on Rails
- Using Rails 3.2.22 and Mongoid 2.5.1 with Mongo 3.2
- Categories Filter doesn't work as expected - Rails 4
- Access id of nested object after creation
- Why Ruby (or Rails) do things like this? (Unexpected model methods without "self" behavior)
- ruby, send invitation to message [on hold]
- Cleaning API Controllers by separating Swagger from the controllers
- Bootsy rails gem not showing images in production
- Remove devise email validation
- Rails - Stripe::InvalidRequestError in Bookings#new Must provide source or customer
- Devise error - ActionController::InvalidAuthenticityToken
- Gitlab CE 8.9 to 8.10 Upgrade Failed
- Postgres: What does @@ mean?
- Change ActiveRecord error blank message for all models
- Find count of predefined words using active record or pure postgres query
- Ruby on Rails rmagick Error
- Speed up rake task by using typhoeus
- Querying Postgres Table with JSONB data
- Rails 4.1: Spacing Issues when using HAML
- Is there any difference between '/' and '' routes?
- How to internationalise jQuery DataTables in Rails 4 app
- Ruby on Rails 5 : how to create a web service delivering nested attributes?
- Rails 4,Setting up CSS Background Image
Using many dynamic Google Maps on modals on the same page - Rails Posted: 27 Sep 2016 07:43 AM PDT I have a shops page with 12 stores. Each store has a button to show it's individual position on the map. The problem is it's not working (I get the same position on every map, it's supposed to be dynamic). What I'm doing is loading a map inside the ruby block for each shop (Map is loading 12 times - 12 requests to the Google API): |
Posted: 27 Sep 2016 07:43 AM PDT Here are my two models: I am trying to get the Here is what happens: First I grab an author: Then I run the query: The generated SQL seems right: But it errors out with the following:
What am I messing up within this scope? I want to keep the hash syntax within this scope. |
Core php for multi-tenant application and recommended php framework which is compatible with php 5.3 Posted: 27 Sep 2016 07:19 AM PDT I was planning to develop my upcoming multi-tenant application on Laravel but my client's server configuration is just PHP 5.3 and current versions of Laravel do not support PHP 5.3, I also looked for Codeigniter and Yii but their latest versions are also not supporting PHP 5.3 and ofcourse in 2016 no new framework is going to support it but my client can't upgrade it as he has his websites running on it. He is asking me to develop the application on CORE PHP so please I would like to have experts advice will it be a good idea to develop multi-tenant application(separate databases for each customer and single code base for all) on CORE PHP on PHP v5.3? Also, please suggest about Ruby on Rails but there will be a learning curve for me as I have no experience of RoR. Your suggestions will be highly appreciated. Thank you. |
Can you define multiple actions with the same name in Rails? Posted: 27 Sep 2016 07:22 AM PDT In asp.net MVC, you can define multiple action methods with the same name, as long as the arguments (the method signature in other words) is different. Can you do this in Rails, or do you have to settle with switch statements inside the same action? |
rake db:migrate error (Migrations are pending) Posted: 27 Sep 2016 07:16 AM PDT I have been searching for a solution to my problem and haven't had any luck. I am a beginner following a tutorial and I reached a point where I had to run the command 'rake db:migrate' and keep getting an error. I have tried to reset the rake with 'rake db:reset' but it tells me that there is a pending migration and to try 'rake db:migrate'. I also tried 'rake db:drop' 'gem update rake' 'bundle update rake' 'bunlde exec rake db:migrate' and still no luck. Can someone assist me with this? I am very new to all of this so if there's anything more I can post please let me know so I can continue to grow and learn! Thanks in advance!! Ubuntu 16.04LTS |
Error when trying to use ruby gem- NameError (uninitialized constant RightScraper::Scraper) Posted: 27 Sep 2016 07:44 AM PDT I am trying to use a ruby gem called right_scraper. I have added the gem to my gem file and it installs fine. I used the example code from the gems github page (https://github.com/rightscale/right_scraper) running this code returns the following error: Does anyone know whats going wrong? |
"undefined method `user' for nil:NilClass" Posted: 27 Sep 2016 07:13 AM PDT Hello everyone I am new to rails and for some reason I keep getting an error "undefined method `user' for nil:NilClass". I have pasted an image of the error on the bottom and I posted the code below. -Thank you. Controller (registeredapps_controller) create#action: Policies (using Pundit Gem) registeredapp_policy.rb Here are my models User.rb Registeredapp.rb |
passing jquery dattimepicker to sqlite database in Ruby on Rails Posted: 27 Sep 2016 07:03 AM PDT So i have a Jquery DataTimePicker implemented and do not know how to pass this field into my Database. Just need some basic help, not even sure where to begin. Any help is greatly appreciated This is what i have as far as code goes. |
Using Rails 3.2.22 and Mongoid 2.5.1 with Mongo 3.2 Posted: 27 Sep 2016 06:54 AM PDT I am attempting to upgrade our legacy rails/mongo application. Our production Mongodb is 2.4 and we would like to upgrade to 3.2 and still use Mongoid. We use auth on the development database as follows The Mongoid.yml file for Mongoid 2.5.1 doesn't seem to have the ability to pass the authentication database parameter, and the authentication fails when trying to perform a rake command, or even get into the rails console. So my question is this, IS there a way to set the default authentication database so that this parameter does not need to be passed along? If not, then is there a way I can edit my 2.5.1 mongoid.yml so include this information? I am guessing the I will have to upgrade the whole nine yards to a version of Mongoid which can support Mongodb 3.2 Below is the pertinent part of the YML file: development: <<: *defaults hosts: - - - - port: database: username: password:<%= SOME_CREDENTIALS[:mongo][:password] %> max_retries_on_connection_failure: 1 |
Categories Filter doesn't work as expected - Rails 4 Posted: 27 Sep 2016 07:28 AM PDT In my app you can search a "tuto" by keywords or by category. When a category is selected all the tutos belonging to this category should be displayed... But it doesn't work...( ALL tutos from ALL categories remain displayed...) What am I missing? Help would be very welcome, thanks in advance. I've created my categories name in the console like so Here is my model with the scopes: my controller, everything happen in the action index EDITand the intersting part of my view, index.html.slim In my select tag the |
Access id of nested object after creation Posted: 27 Sep 2016 07:31 AM PDT I 'm creating an object through nested attributes in rails and I need to access this object after the creation on the same method. This line sometimes creates a child (an address). Is there any way to get the address id if there is one? |
Why Ruby (or Rails) do things like this? (Unexpected model methods without "self" behavior) Posted: 27 Sep 2016 06:56 AM PDT I've got a validator in ActiveRecord model, in which I faced with some realy strange behavior. Example: Second condition always failed, because Can someone explain it? Because I don't really get what's going on here. And I don't want to live in fear of missing |
ruby, send invitation to message [on hold] Posted: 27 Sep 2016 06:28 AM PDT I would like to know if it's possible that you help me . I try to create a systeme who enable to send an invitation for speak. i have 1 user A who want to speak with user B User A send an invitation as notification to User B, User B open notification witch return on a page where they have 2 choice possible accept or don't accept if User B accept they can conversation open else invitation DELETE. So i have create my model "add" "user" " conversation" "notification" i need only a methode for my Add controller for send invitation as notification . ty. |
Cleaning API Controllers by separating Swagger from the controllers Posted: 27 Sep 2016 07:21 AM PDT I'm using Swagger as a UI for my rails API. That means that in my API controllers, I have a lot of swagger blocs of code, making my files hard and heavy to read. I'm looking for a way to separate concerns. This is what I had: In my controllers/api/v1/stuffs_controller.rb And it's like that for every action in every controller :s I tried creating modules to encapsulate Swagger UI logic and clean up a little bit my controllers. This is what I came up with (that doesn't work): In controllers/api/v1/stuffs_controller.rb: Then in lib/swagger_modules/recipes_controller_module.rb: This produces the following error when I try to use swagger UI or restart the server: I added Is there something I am missing ? Is it a good practice to separate swagger logic from my controllers ? Thanks :) |
Bootsy rails gem not showing images in production Posted: 27 Sep 2016 06:22 AM PDT I'm using bootsy (https://github.com/volmer/bootsy) to make formatting my Blog article body much easier. When I upload files in the WYSIWYG editor locally I can view them later just fine; however, when I am in production and do this all the img tags link to Instead, the path should be a aws s3 url. I am using s3 with carrierwave = for some other things (the post main image url), and I'm not having any problems. I imagine there is some kind of config I need to do to work in production. |
Remove devise email validation Posted: 27 Sep 2016 06:09 AM PDT I use devise and devise-token-auth. I have User model with following content but devise email validation is still working Why this? Thanks |
Rails - Stripe::InvalidRequestError in Bookings#new Must provide source or customer Posted: 27 Sep 2016 06:06 AM PDT I'm getting the above error in my Rails app. I have the following Stripe code in my Booking model - I don't understand why I'm getting the error when I'm clearly including source within my stripe code. I've expressed it above as self.stripe_token but I've tried just stripe_token but still get the same error. My understanding is I need to provide either source or customer, not both, and that it needs to be source rather than customer. What am I missing? |
Devise error - ActionController::InvalidAuthenticityToken Posted: 27 Sep 2016 05:59 AM PDT Got problem in devise logout while admin and user logged in same page For example i logged as user in chrome browser and logged as admin in the same browser,when i logged out of admin session the user session is automatically logged out and redirect to sign in page. |
Gitlab CE 8.9 to 8.10 Upgrade Failed Posted: 27 Sep 2016 05:51 AM PDT I've been updating my server through the newer GitLab versions, I was at 6.7 yesterday in the evening, and currently I'm up to 8.10. Currently when starting the GitLab service, Sidekiq fails with "Could not find ace-rails-ap-4.1.0 in any of the sources". I've done all that I can to verify that that gem exists in the vendor sources along with gitlab, but no luck. log/sidekiq.log is as follows: Using Ruby 2.3.1, Ubuntu 14.04. |
Posted: 27 Sep 2016 07:17 AM PDT Recently I've found a piece of code for ruby on rails which should search string like But couldn't find any documentation about it. The operator doesn't work as expected. So what exactly it does? |
Change ActiveRecord error blank message for all models Posted: 27 Sep 2016 05:34 AM PDT I know that custom error message can be added in locale .yml file like this: How do I change error blank message for all the models at a time? |
Find count of predefined words using active record or pure postgres query Posted: 27 Sep 2016 05:43 AM PDT I want to get some text analysis. As a result I want to get count of some key words in all records like this:
and result should be like this:
I don't want to select all records and then map them count this key words on ruby etc because of big amount of data. Also I find some solution:
Works fine for 1 keyword. This causes problem that I used to do database request per keyword. I'm using rails 4 and potgres. Any help appreciated |
Posted: 27 Sep 2016 07:17 AM PDT My Ruby Version is:ruby-2.1.8 [ i686 ] Rails Version is: 4.2.4 I have cloned a new project.Whenever i run bundle install command i get the above error.Because of this error i'm unable to run my project.So pls help. |
Speed up rake task by using typhoeus Posted: 27 Sep 2016 05:12 AM PDT So i stumbled across this: https://github.com/typhoeus/typhoeus I'm wondering if this is what i need to speed up my rake task I'm wondering if this would speed it up, Or because i'm doing a If it would could you provide an example? Sam |
Querying Postgres Table with JSONB data Posted: 27 Sep 2016 05:04 AM PDT I have a Table which stores data in a JSONB column. Now, what i want to do is, query that table, and fetch records, which have specific values for a key. This works fine: But what i want to do is, fetch all the rows in the table, which have types I tried this: But this doesn't seem to work. I also tried this: Which works, but if I specify a key like so BTW, I am using Ruby on Rails with Postgres, so all the queries are going through |
Rails 4.1: Spacing Issues when using HAML Posted: 27 Sep 2016 07:26 AM PDT First time HAML wth Ruby on Rails , I want to align the average no of comments with the months. So the first one aligns but not the rest. monthly.stats.html.haml I am using for spaces but this is not spacing correctly |
Is there any difference between '/' and '' routes? Posted: 27 Sep 2016 05:28 AM PDT Is there a difference between these 2 Rails routes: vs. Both seem to match the root. |
How to internationalise jQuery DataTables in Rails 4 app Posted: 27 Sep 2016 05:13 AM PDT in order to display some data we use jQuery datatables. So far we implemented full internationalisation of our app (I18n) except for table features like pagination or search bar descriptions. I don't seem to fully understand the way I18n works and on which event I would have to update the link to the DataTables localisation JSON in order to dynamically update the I hope the problem is described appropriately. Thanks for any hints! best Andi |
Ruby on Rails 5 : how to create a web service delivering nested attributes? Posted: 27 Sep 2016 05:45 AM PDT I am developing a RoR5 application to provide crypto keys to various applications, through a web service. My RoR application manages Users, and nested Ciphers (using nested attributes). A cipher has a name, and a value (string). I wish to expose a web service to deliver the requested key: 1 - The client application provides a User and a Cipher name to the web service 2 - The web service returns the Cipher value I am not expert in RoR, but I have the intuition that I should start by defining a new route for this service. Here is the current routes.rb: Hints on how to structure the application and references are welcome ! |
Rails 4,Setting up CSS Background Image Posted: 27 Sep 2016 05:20 AM PDT I want to set a background image via CSS Thats it. I have this div And the css for it. I have image.jgp on my assets/images folder.I can do <%= image_tag('assets/image.jgp') and it works.But CSS part doesn't.` How this problem could be solved? |
You are subscribed to email updates from Newest questions tagged ruby-on-rails - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment