Rails 5 - ENV DATABASE_URL - specify encoding and collation | Fixed issues |
- Rails 5 - ENV DATABASE_URL - specify encoding and collation
- Rails.application.secrets.KEY_NAME returns Uninitiated Constant (NameError)
- Add class to image_tag in Rails with IF statement
- Rails Cart deleting itself
- Most recent record form Elasticsearch Rails based on Multiple indices
- batch jpg images in string not all written to file with ruby file open write barby gem
- How to assign two foreign keys to the same parent table with rails migration? [duplicate]
- Rails - How to ensure a parameter is updated correctly
- OpenSSL::PKey::RSAError (Neither PUB key nor PRIV key: nested asn1 error) while using Grocer gem on RoR app
- undefined method 'to_model' when linking thumbnail to original image
- How to check remove image? I can not check because before save averter.present? return true
- Issue installing ruby 2.3.1 with rvm on Linux Mint Rafaela
- rspec error michael hartl lesson 3
- Using ruby on rails on windows [on hold]
- social-share-button gem not working when a social site icon is clicked
- Algolia_search on nested model
- Ruby gem cucumber SSL error and Gem sources
- how to create a model corresponding a view in rails
- Deprecation warnings in Rails 5
- Rails test keeps crashing
- search records by user in the scope
- ./phantomjs: error while loading shared libraries: libssl.so.1.0.0 in AWS
- how to display each object in array in rails form_for
- Rails active admin undefined methods
- .where returns nil exception if user does not enter anything rails 4
- Rails like query return records if posted empty
- Notify.js with rails
- How to keep array structure when saving record - activerecord/postgres
- Raise an error on Ruby/Script generate scaffold
- How do I search within an JSON array of hashes by hash values?
Rails 5 - ENV DATABASE_URL - specify encoding and collation Posted: 06 Oct 2016 08:00 AM PDT Our database.yml is added to
I tried padding it to query parameters, like the The tables created are still using the default encoding/collation so I assume the parameters doesn't work. Is there any way I could configure this by any other methods? Encoding and collation is the same for all environments. Requirement is that dev environment can have a file with a config whereas prod should have no special file added, it should only use ENV variables. Maybe add this to one of the files inside config dir like application.rb or other files? Thanks in advance. PS: I'm new to Rails and Ruby (1 week) since I'm coming from PHP/Python. |
Rails.application.secrets.KEY_NAME returns Uninitiated Constant (NameError) Posted: 06 Oct 2016 07:56 AM PDT I am trying to access an API and cannot get the key in secrets.yml to authorize. I have gone into rails console and confirmed that Rails.application.secrets.KEY_NAME returns the correct key. But it isn't working when I run the .rb file. How can I get it to work the way it's supposed to? |
Add class to image_tag in Rails with IF statement Posted: 06 Oct 2016 07:52 AM PDT I have a image tag setup for a blog that if an image has been attached to the blog then display the image. I am trying to add a class to this image tag so that I can use CSS to edit it. I have tried a few different ways to add the class but none seem to work. or or does anyone know how to add a class to this type of statement? |
Posted: 06 Oct 2016 07:44 AM PDT I'm having an issue with my cart in an e-commerce app. When the user signs in and adds an item to Cart, the item does not add immediately. The user has to go back and add it a second time before it goes into the cart. I've looked at the logs and i've been able to find that the issue occurs when a user has previously purchased something and is signing to purchase at a later time.The next time they log in to purchase another item, is when it occurs. The system tries to delete the old cart and create a new one but what ultimately happens is, the new cart shows up empty on first attempt. Is there a way to avoid this? Any help would be appreciated. Thanks in advance!
|
Most recent record form Elasticsearch Rails based on Multiple indices Posted: 06 Oct 2016 07:48 AM PDT I have two models in my Rails application: Share and Rent. I'm starting to use ElasticSearch in my application and wanted a way to bring the models rent and share most recent. I tried the following: But I do not know how to bring the most recent based on create_at field. |
batch jpg images in string not all written to file with ruby file open write barby gem Posted: 06 Oct 2016 07:41 AM PDT I am using barby gem to generate barcodes. I am doing it a batch at a time and then save all of them in a file to be viewed by the user. I am not trying to print one at a time. the view
My code.jpg got processed but I only have 1 image. |
How to assign two foreign keys to the same parent table with rails migration? [duplicate] Posted: 06 Oct 2016 07:33 AM PDT This question already has an answer here: I have But there is only one column created in Questions:
|
Rails - How to ensure a parameter is updated correctly Posted: 06 Oct 2016 07:48 AM PDT I'm building an events app using rails. For the payment process I'm using Stripe and some javascript to update the amounts. I want the user to be able to specify the number of spaces (quantity) they wish to pay for and for this to update the total amount they then need to pay. The code I'm using is updating the text for the total amount payable but it's not updating the server so every time I do a test payment only one single amount is collected. So, if an event costs £10 per space and I try and input, say, 4 spaces (£40) when I do a test only £10 has been collected by Stripe. I need to ensure the quantity parameter is being passed correctly. This is my booking page code - new.booking.html.erb This is my controller code with the quantity param - bookings_controller.rb How do I amend this so the total amount is correctly collected? |
Posted: 06 Oct 2016 07:23 AM PDT I know there are a lot of questions on this scenario but I've tried every solution and I am still stuck. I am using the grocer gem to send push notifications to the APN service. I am stuck on the certificate issue. Here's the code I am in a production environment where I am hosting the app on Heroku. Heroku logs show me this Line 49 is the line where the notification is pushed. I'm certain that the certificate I'm using is proper as I have tested push notifications using it. Also when generating the pem file I have exported both the certificate as well as the private key. Reference: grocer gem Any suggestions are welcome! |
undefined method 'to_model' when linking thumbnail to original image Posted: 06 Oct 2016 07:25 AM PDT I'm creating an album that I'm planning to display with Masonry and ImgZoom so that the visitors can have a bigger image when they click on it. According to ImgZoom, to make the zoom work, you need to do the following: So I generated an uploader, with the following inside it: Everything works perfectly, I can call both the versions without trouble, but when I try to follow ImgZoom's instructions by doing the following: or: I'm getting the following error: I found a similar subject on stack overflow but the asker wasn't clear and was invited to ask an other question on the forum, which I couldn't find. I can individually reach 'p.image' and 'p.image.thumb.url', but I can't make a link from one to another, which would be perfectly doable with simple html. What am I doing wrong? Thank you in advance |
How to check remove image? I can not check because before save averter.present? return true Posted: 06 Oct 2016 07:37 AM PDT before save My Validation In I try Because after_save, How to check I want to check Already made a method for delete all image crop data( |
Issue installing ruby 2.3.1 with rvm on Linux Mint Rafaela Posted: 06 Oct 2016 07:03 AM PDT I'm trying to install I mean, seems like it's not finding a candidate for Linux Mint, but still, it looks like it's installing,so I don't get it. Any ideas about this? Could it be Thanks in advance! |
rspec error michael hartl lesson 3 Posted: 06 Oct 2016 07:02 AM PDT while executing the command $ bundle exec rspec spec/requests/static_pages_spec.rb i get this error /home/sarfraz/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in this is my gemfile: source 'https://rubygems.org' Bundle edge Rails instead: gem 'rails', github: 'rails/rails'gem 'rails', '4.0.8' Use sqlite3 as the database for Active Recordgroup :development, :test do gem 'sqlite3' gem 'rspec-rails', '2.13.1' end group :test do gem 'selenium-webdriver', '2.35.1' gem 'capybara', '2.1.0' end Use SCSS for stylesheetsgem 'sass-rails', '~> 4.0.2' Use Uglifier as compressor for JavaScript assetsgem 'uglifier', '>= 1.3.0' Use CoffeeScript for .js.coffee assets and viewsgem 'coffee-rails', '~> 4.0.0' gem 'therubyracer', platforms: :rubyUse jquery as the JavaScript librarygem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 1.2' group :doc do # bundle exec rake doc:rails generates the API under doc/api. gem 'sdoc', require: false end group :production do gem 'pg', '0.15.1' gem 'rails_12factor', '0.0.2' end Use ActiveModel has_secure_passwordgem 'bcrypt', '~> 3.1.7'Use unicorn as the app servergem 'unicorn'Use Capistrano for deploymentgem 'capistrano', group: :developmentUse debuggergem 'debugger', group: [:development, :test]please help i cannot proceed totally stuck.. Thanks in advance |
Using ruby on rails on windows [on hold] Posted: 06 Oct 2016 07:00 AM PDT Goood day people, please im trying to use ruby on rails on windows with great difficulty, i already installed the ruby, installed rails, installed sqlLite. I already created an application using "rails new app". i tried the run bundle command but it just spewed out a bunch of tips. Can you help on how to use ruby on rails on windows |
social-share-button gem not working when a social site icon is clicked Posted: 06 Oct 2016 06:54 AM PDT I am using social-share-button gem to share stories in social networks like facebook, twitter, etc. Whenever a social site button is clicked, it is just going to the top of the page instead of showing a pop-up or new tab to share. I have used https://github.com/huacnlee/social-share-button. Can anyone suggest where I have gone wrong? |
Algolia_search on nested model Posted: 06 Oct 2016 06:28 AM PDT I got a I'm using a form to retrieve users, with Algoliasearch, and I would like to retrieve all users that have a particular skill (I.E, if I got a user called "John", which has the "Origami" skill, he should appear in results if I type "John" or "Origami") I tried to do so by mapping the nested skills, but this doesn't seem to work Here's the model The form returns a Did I miss something ? Is it possible to map a nested model ? |
Ruby gem cucumber SSL error and Gem sources Posted: 06 Oct 2016 07:58 AM PDT I was trying to install cucumber gem for Ruby. Although there were few topics somewhat related to this, I can't find exact question with exact answer. When on Windows I try to run the command
Then, I googled for a solution and found some suggestions to remove source in here. I ran But did that not only in cucumber. Now I'm even unable to add source. |
how to create a model corresponding a view in rails Posted: 06 Oct 2016 06:56 AM PDT I created a view "Employee_Details" in mysql, which is combination of 7 tables like "user", "user_details", "location", "offer_letters", "employee_details", "client" etc. It showing all details of a user. I am accessing all values with the help of hr_controller.rb with sqlconnection.rb file. sqlconnection.rb file create in model folder and it's contain all sql connection. But I want to create a model for Employee_Details. Can i access all information of Employee_Details view, with the help of new model After that I will export all information into excel file |
Deprecation warnings in Rails 5 Posted: 06 Oct 2016 07:13 AM PDT Every time I execute my tests, I get these deprecation warnings: When I check line 5 of When I search my repo for |
Posted: 06 Oct 2016 06:10 AM PDT Everytime I run
Sometimes when I run Any help please? |
search records by user in the scope Posted: 06 Oct 2016 06:12 AM PDT I need to search all the records where But I get this error:
Can I not call the |
./phantomjs: error while loading shared libraries: libssl.so.1.0.0 in AWS Posted: 06 Oct 2016 06:18 AM PDT I am having phantomjs 2.0.0 for screen capturescenario in my Rails application. It is working fine in production mode but when I moved the code to AWS, it is showing error as: (For example I am trying to check the version)
Please help. |
how to display each object in array in rails form_for Posted: 06 Oct 2016 06:07 AM PDT when I create a question like this, The edit form displays every wrong_answer text fields as ["1", "4", "3"]. My question is how do I get it to display each number on different text fields. |
Rails active admin undefined methods Posted: 06 Oct 2016 06:40 AM PDT I'm using this code: and I get this error: if I delete 'section' do-end part, then I get error for: and so on... Seems like I cant use any of active admin given methods, maybe I'm mising something? Any gems or something? I installed active admin gem using this setup: I'm using rails 5 |
.where returns nil exception if user does not enter anything rails 4 Posted: 06 Oct 2016 05:38 AM PDT I want to query some data from table based on user for submission. Its working fine but if I post nothing in the the fields and post my form, it returns me nil exception. Is there a way we can deal with nil exception, or do I need to change query? |
Rails like query return records if posted empty Posted: 06 Oct 2016 05:30 AM PDT I am having an issue, if I post an empty text field for searching records using like query it started to show records: Code is: Output: |
Posted: 06 Oct 2016 07:40 AM PDT I have a simple notification template. I just want to apply a notification alert in my page. Not for button click, I need to show it after sign in / sign out events like that. I found a library which is very simple. Here is the link I used it's styles and load it. It display correctly but jquery functions are not working. Here is my code for template JS file What am I missing here? |
How to keep array structure when saving record - activerecord/postgres Posted: 06 Oct 2016 06:57 AM PDT I created an array structure of hashes and i created a column in postgres to save that structure using the migration below now, the structure of the array is the one below but for some reason in database it is saved like this any ideas why? I tried chanign the type of array from :text, to :varchar and got same result. The only solution i found is using eval command to convert string back to array which is not ideal. |
Raise an error on Ruby/Script generate scaffold Posted: 06 Oct 2016 05:27 AM PDT Hi guys i am currently still learning Ruby. Anyway i am on chapter 13 on web application development.I am stuck at this part for ruby script/generate Entry tittle:string content:text Based on my research i have came across this link: Why does Ruby "script/generate" return "No such file or directory"? Apparently i used Rails 3. so this is what happened.I located to my directory i run this command D:\RubyProjects/Part-3/Chapter-13/rails/mydiary> rails generate scaffold Entry title:string content:text Now i got this error: Bundler could not find compatible version for gem "bundler Current Bundler version: 1.13.2 This Gemfile requires a different version of Bundler. And i also tried to run this as well: install bundle, gem install bundle Can anyone help me on this? |
How do I search within an JSON array of hashes by hash values? Posted: 06 Oct 2016 06:37 AM PDT I am using Postgres' JSON data type to store some information. For example I have model I want to query with I want to query for users that have at least one location with Thanks! |
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