Create databases with Postgres for a cloned application | Fixed issues |
- Create databases with Postgres for a cloned application
- Double compression on gziped sitemap on elastic beanstalk rails
- Cucumber-rails - Remove gem and all dependencies
- How to call controller function from javascript generated button in Rails 4 app?
- Testing a gem that uses ActiveRecord models using Postgres + Rspec
- why id changed to _id when I use rails cache to get data
- Search Multi models on ruby rails
- Enable SSL on Ruby on Rails app with Nginx and Puma
- Rails deep and advanced features [on hold]
- Upload images into S3 bucket with ruby?
- Searching nested associations in Rails?
- Heroku - custom domain DNS
- Issue regarding ExecJS in rails 5
- PG::UndefinedTable: ERROR: relation does not exist for Multitenant Rails App
- Google API Key for Rails App for shorten url
- Excel to pdf conversion in rails4 with libreoffice
- Testing Devise Using capybara rspec and factory girl
- Ruby sub-oject with dynamics presence of fields
- Difference beetwen install GEM and Copy and IMPORT the JS file
- syntax error, unexpected end-of-input, expecting keyword_end
- Implement "add to favorites"
- Accessing first element of array in rails
- Send_file does not down load the file
- Ruby - Rails 4 - Pundit - Policy and authorization error for a route #index_fr?
- Is it possible to test other applications like https://www.google.com using capybara in Rails?
- Dynamically get records between two dates
- Trying to use files from AWS in prawn, got 403 error. But in my view i can upload and download with no problems
- RabbitMq(bunny): Rabbitmq deleting message from queue . acknowledgement not working
- Function draws Error with Postgres Databse but not on Sqlite
- rails eager_load from multiple association with different condition
Create databases with Postgres for a cloned application Posted: 26 Oct 2016 07:44 AM PDT I cloned a BitBucket repository and now I would like to create only the development and test databases (excluded production) specified in What are the differences between the following commands? |
Double compression on gziped sitemap on elastic beanstalk rails Posted: 26 Oct 2016 07:29 AM PDT I have a rails application running on AWS elastic beanstalk. For sitemap generation I am using this sitemap generator gem. The setup in my The sitemap gets generated by a cron job. To deliver the sitemap I have added this rule in my The file will be delivered to the browser but as it seems it is gzipped twice. Unpacking Am I doing anything wrong? What is causing the second compression? How can I prevent it? |
Cucumber-rails - Remove gem and all dependencies Posted: 26 Oct 2016 07:25 AM PDT Is it possible to remove a gem and automatically all their dependencies? If it is possible, how can I do that? |
How to call controller function from javascript generated button in Rails 4 app? Posted: 26 Oct 2016 07:09 AM PDT I have integrated Stripe.js in my rails app. The app produces "Pay with Card" button. I would like to know how can I call a controller function for calling Stripe APIs for receiving payment. show.html.erb: shopping_carts_controller.rb How can I call the checkout method? |
Testing a gem that uses ActiveRecord models using Postgres + Rspec Posted: 26 Oct 2016 07:31 AM PDT I'm trying to test some models in a gem using Rspec and Postgres. Currently trying to do this by running a rake task in the spec_helper.rb file that will establish the pg database connection for the duration of my Rspec tests. I've scanned other questions (my approach is largely based on these two questions 1, 2) and haven't discovered a good solution. I'm not using the sqlite in-memory db feature due to the way our code is written. Custom spec_helper looks like this: However when I run rspec it tells me that there is no connection pool: Does anyone have any advice or insight on this issue? It would be much appreciated. |
why id changed to _id when I use rails cache to get data Posted: 26 Oct 2016 06:59 AM PDT I'm using Rails with grape and Mongo, I wanna use Rails cache to optimize performance, and this is my code: the cache is valid, but the return data changed. add cache before, return data is: otherwise, after adding cache, return data is: the 'id' field changed to '_id' I don't know what happened, how to resolve this issue? |
Search Multi models on ruby rails Posted: 26 Oct 2016 07:12 AM PDT As a still beginner in to ruby rails and I'm trying to create a simple search option to website that I'm devolving I have number of models such as Sundries, Curry and Starter. my search work fine if I have a one model but how do I search all models title or name ? I have added following command to each models and tried to display results in home page. but no luck! Can someone please help me that with a example please? Thank you. |
Enable SSL on Ruby on Rails app with Nginx and Puma Posted: 26 Oct 2016 07:21 AM PDT Here is my Nginx conf file: The path to certificates are correct but when I access https://example.com it stay loading forever. Is there any problem with my SSL setup? |
Rails deep and advanced features [on hold] Posted: 26 Oct 2016 06:30 AM PDT I wish to get deep into Rails Framework with Ruby language, I stared with some simple book about Ruby language and is enough, but now I want to learn the advanced feature of rails framework, how middleware works, how memory is managed, threads, complexity, racks etc. and, apologize me, not the "stupid" MVC aspects like "Put views here, controllers here. models here and everythings will work". I want to understand why this and that. So, not a text to build app faster but to understand framework's principles. Any books? Thank you. |
Upload images into S3 bucket with ruby? Posted: 26 Oct 2016 06:33 AM PDT I able to upload to the bucket like this
but I want to upload the file into a folder inside the bucket? |
Searching nested associations in Rails? Posted: 26 Oct 2016 06:54 AM PDT I have the following hierarchy of models:
So e.g, if Bob is connected to Jane, and Jane is in his Friends contact group, then it will look like this:
My question is, how would I find all of Bob's contacts which have the phone +12345? This would need to search: user -> connections -> contactDetails -> phones -> phone Ideally this should be a scope on the user model, but it can also be a method. Any ideas? |
Posted: 26 Oct 2016 06:07 AM PDT I am a complete newbie when it comes to redirecting etc. I bought a domain (mydomain.co) and I have a heroku app (mydomain.herokuapp.com) (upgrading to paid in the upcoming month). What I want to do is to be able to access the heroku app after entering the domain url and stay o this domain, and not be redirected to mydomain.herokuapp.com. My settings for the domain look like this (I translated it myself, so there may be some mistakes): With this settings, I can access my app but it is displayed in a frame, what's more - some of the pages do not work. What I want to do is to be able to type mydomain.co and display mydomain.herokuapp.com but as regular site, and not inside a frame. What options should I choose? Another thing is - will I be able to use the domain (which I paid for) and do the redirect if I do not buy a hosting from the company? PS I added custom domains to my herokuapp and read their [guide], but I still do not understand.3. Here are also my domain records - I believe it has something to do with this, but it so hard to test it as those DNS changes take some time. |
Issue regarding ExecJS in rails 5 Posted: 26 Oct 2016 05:23 AM PDT I am using rails 5 and I am using the following tutorial to generate an app for real time notification using action cable. The link of the tutorial is : http://myprogrammingblog.com/2016/08/22/rails5-actioncable-realtime-notifications-part3/ Now the source code is available here: https://github.com/myprogrammingblog/notificator-rails5-example Now after cloning it and running bundle install and all other necessary migrations,when I am going to start the application then the following error message is being prompted. It is bit weird and I did not get any valid reasoning yet. The error is: ExecJS::ProgramError in Notification#index Showing C:/Ruby22/rails/notificator-rails5-example/app/views/notifications/_counter.html.erb where line #2 raised: TypeError: Object doesn't support this property or method where the corresponding code section is : bell.png is placed under the assets/images folder and it looks like everything is fine. Please help me to figure out this. Thanks in advance! |
PG::UndefinedTable: ERROR: relation does not exist for Multitenant Rails App Posted: 26 Oct 2016 05:49 AM PDT I am working on a Multi-tenant Ruby on Rails App along with another developer. I pulled his branch and received new migration files. I ran rake db:migrate. I visit the index of that controller and I get the undefined error. After some research I understood that I ran migration after I created my Tenant. (Reference: PG::UndefinedTable: ERROR: relation "..." does not exist) and I also understand that rake db:reset resolved this issue in development. But doing a reset purges my data which I am fine with in development. My concern is, how does this work in production? When I release to production... does that mean that for existing tenants I cannot run migrations and ship new features? Is there a permanent solution to this? |
Google API Key for Rails App for shorten url Posted: 26 Oct 2016 05:19 AM PDT I am trying to use the Google Api key to generate the shorten url for the rails app. Can any one help how to use the keys to achieve it. |
Excel to pdf conversion in rails4 with libreoffice Posted: 26 Oct 2016 05:19 AM PDT In a rails 4 application, how can I convert an excel spreadsheet file into pdf. When I am trying to implement Excel to pdf the contents are listed in different pages if excel column size is large. How to generate the pdf without moving data to next pages in pdf. Please help, Thanks |
Testing Devise Using capybara rspec and factory girl Posted: 26 Oct 2016 05:01 AM PDT i'm new at rails and i'm testing my devise gem User with capybara rspec and factory girl. Here's spec code: The problem is in
Here's factory: Maybe I missed something or going with a wrong way. How should I test here? |
Ruby sub-oject with dynamics presence of fields Posted: 26 Oct 2016 04:40 AM PDT I quite new ruby (rails) developer and I need to interface a complex object behavior. I'll try to explain as much as I can. I've an object A in which I would like to contains an array of entities(B) which have a boolean base and a type. If this boolean is true some other properties can be set (and input fields can be showed in dashboard). I don't really want to create a separate object(B). I know I could use By the way the array of B entities could be initialized when creating A object depends on A params and B type. So my questions are:
I hope it's understandable. Thanks |
Difference beetwen install GEM and Copy and IMPORT the JS file Posted: 26 Oct 2016 07:43 AM PDT I have the desire to know the diference between copy the JS and SASS file and import in the application.js and application.css and install a GEM... Specifically I would like to install select2, could there be any performance difference in the implementation of plugin or something? |
syntax error, unexpected end-of-input, expecting keyword_end Posted: 26 Oct 2016 04:27 AM PDT I have really tried to find out where I haven't closed some code but it all seems right to me. What have I done? I have checked all of the code carefully and hope someone can solve this for me!!! |
Posted: 26 Oct 2016 03:57 AM PDT I am creating an app where a user can favorite a room. I started with a has_and_belongs_to_many association. But then I just noticed that it is very tricky to implement a remove button with drestroy. So I decided to do it this time with a has_many through association. I have a users who should add rooms to favorite or wishlist. Unfortunately when I click on the favorite button I am getting this error: What I am missing how can I make this work? If you need further information just let me know. I have used this as a direction. Implement "Add to favorites" in Rails 3 & 4 favorite_room.rb room.rb user.rb routes.rb rooms_controller.rb show.html.erb create_favorite_rooms.rb (migration file) |
Accessing first element of array in rails Posted: 26 Oct 2016 05:01 AM PDT I am getting below json from backend. I dont want direction as array. I want it as object so I wrote method drug_format to parse json My ruby on rails code for parsing is as follows : Now when I am trying to run my code I am getting following error. What can be the issue? |
Send_file does not down load the file Posted: 26 Oct 2016 04:19 AM PDT I have an application with Rails 3.2.22 and Ruby 2.2. I'm trying to implement the send_file in my application. My download action will be triggered from a button click. corresponding Ajax call implementation with the click event is given below. Controller action code is given below every time i hit this action by a button click it says file is sent. but does not download in the browser. If i manually hit the route in the browser, file is getting downloaded.I want a button click to download the file. What i'm doing wrong. any help :) |
Ruby - Rails 4 - Pundit - Policy and authorization error for a route #index_fr? Posted: 26 Oct 2016 03:15 AM PDT Sorry, I didn't see another place to ask a question about Pundit... Thank you for your help. I am working on a Ruby on rails API and I would like to create an url (.../api/v1/attractions/fr) list some information about one of my models. But I've got this error message from Pundit :
and this error for verify_authorized in the lib/pundit.rb file This is my configuration : |
Is it possible to test other applications like https://www.google.com using capybara in Rails? Posted: 26 Oct 2016 03:48 AM PDT I am new to write test case in Rails. Is it possible to write test cases to test other applications like https://www.google.com using capybara in Rails ? |
Dynamically get records between two dates Posted: 26 Oct 2016 04:06 AM PDT I'm working on a project at the moment where I have a voting system and on the index page for the vote model I can see the average vote for the last week. However I'd like to be able to have the user be able to choose the date between which the rating is averaged. I'm not sure how to go about doing this. Currently I have a view which shows @average which is defined as: My initial though was to include a 'date range' attribute to the model and then have the average calculated from those dates, which is set by a form in the index view, but that seems like a lot of overhead for such a simple task. Any help would be greatly appreciated. |
Posted: 26 Oct 2016 02:50 AM PDT I have my AWS S3 account, and it everything setted up so it works with my upload files (using carrierwave gem) and downloading it so i can show it using html code. I am finding an issue once i want to generate a pdf using that same image( lets say image link from amazon S3). The problem here is, and this is why i don't understand, why i can with no issue upload files, download then to show on my view, only in Prawn i get this error if i change my image path to a open build like google's logo it works with no issue, so i am thinking that the problem is in the authorisation between prawn and AWS. I have already tried using the direct link that i can see inspecting the image form my view, and using it. And i got the same error. I have already tried using also this CarrierWave configure inside my prawn controller, no error messages besides the same ones, saying that it is Forbidden. My question is, how can i do this? I actually don't want to download the image, save it on my server use it for prawn and then deleted. There should be another way of doing this, or can't i just make the session open and use the same link twice? A little note: @shop_logo has the link where the imaged it stored in AWS, the real link. |
RabbitMq(bunny): Rabbitmq deleting message from queue . acknowledgement not working Posted: 26 Oct 2016 04:04 AM PDT I am processing records from my rabbitMQ. in order to avoid loss of messages from rabbitMQ i am using rabbitMQ acknowledgment strategey. For testing purpose i have raises the exception just before the code where i gave acknowledgment back to the rabbitMQ. as per the code that i have written rabbitMQ should not delete the message from queue untile the line in my code i.e "c.ack(delivery_info.delivery_tag)" is executed. Below is my code Please help me in undestnding why rabbitMQ is deleting message from queue even if the line "c.ack(delivery_info.delivery_tag)" is not executed. |
Function draws Error with Postgres Databse but not on Sqlite Posted: 26 Oct 2016 06:41 AM PDT So after shifting my code to heroku which is in Postgres one of my functions is drawing an error. The particular line that gets highlighted is this I have read that certain calls works with sqlite and not with postgres such as doing Here's the error that is coming up
I don't know what to search to try and resolve this since i dont even know what is it about postgres that is triggering the error. So hopefully someone can point me in the right direction. Here's what the tutor model looks like The other subject searches are all the same as I think one of the problems i have deduced would be this, in my In my rails console i ran Why though? Im sorry but im really quite bad with postgres and i dont understand whats going on and why it worked with sqlite3. (I read that sqlite3 is not as strict as postgres but that doesn't exactly make it clear for me) |
rails eager_load from multiple association with different condition Posted: 26 Oct 2016 02:16 AM PDT I want a How can I do this? |
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