Deploying Rails application from archive | Fixed issues |
- Deploying Rails application from archive
- Capistrano overrides routes.rb
- rails postgresql query regex length limit
- Permit array in params
- Trying to open .rb file but I get an error message "in '<main>'undefined local variable or method 'quit for main: Object (NameError)
- An "yml" config file doesn't exist after deploying to heroku
- What is the best way to share a text file between cluster nodes?
- Pubnub going to stuck after publish some messages
- How to add price upon checking a check_box in Ruby on Rails
- rails each method reset in controller workaround
- MySQL Regular expressions: How to match digits in the string with \d?
- Want to schedule a task on every 2 hours from 8am to 12pm on heroku through scheduler add on
- tests failing after change default timezone for activerecord
- Rails/Sqlite 3 - Displaying table data on page
- How to create functional test for Ruby on Rails
- Rails joining tables having has_many association
- Error sending emails with Rails 4 & Devise (connection refused, port 25)
- Add more markers to markerCluster without removing previous
- Query in Ruby on Rails 4 to make a selection based on the current user
- Getting text only when nokogiri certain HTML structure
- Rails and MQTT: Subscribe to topic in background at server startup?
- Rails/Stripe: No such token
- Can't modify frozen hash. Rails 4.1 and SSE
- rails devise undefined method username when I want to use it with cancancan
- How to call rails api using parameter
- f.select not preselecting value while editing
- Ruby on Rails - Show only 3 image pr page
- Send email out after new employee registered by overriding Devise Registrations controller
- ajax call to changes drop down on basis of other drop down rails
- Send xlsx file to front end - AngularJS
Deploying Rails application from archive Posted: 29 Aug 2016 07:35 AM PDT I need to deploy a new version of a Rails server to a machine that doesn't have access to its Git repository. What's the best way to do it? Is there anyway to deploy a Rails server (preferably using Capistrano) from a prepacked archive? |
Capistrano overrides routes.rb Posted: 29 Aug 2016 07:33 AM PDT I have a problem: Always I ran cap production deploy Capistrano overrides my config/routes.rb to default rails code. Any idea? Thanks in advance! CapFile config/deploy.rb config/routes.rb |
rails postgresql query regex length limit Posted: 29 Aug 2016 07:38 AM PDT I am making a rails app and I need to use long regular expressions in my queries. I found that in the Postgrssql is a 32 kilobyte limit on regular expression length. Here is how my query looks like, regex that I am using is around 1 million characters long But this query raises an error |
Posted: 29 Aug 2016 07:25 AM PDT I have the following JSON: And I pass this JSON using POST to my controller, then I need to trust this paramters but I'm not be able to permit the array of hash How to permit it? I tried |
Posted: 29 Aug 2016 07:11 AM PDT I'm completely new to coding and just started 2 days ago but I'm sticking with it, it's really exciting to learn! I'm learning ruby first and the course gives me a folder of .rb files to follow along but I noticed when I double click the .rb file it opens command prompt but immediately closes every time. I looked up this issue and they said to find the path of the file in command prompt and open the file through command prompt directly instead, but when I navigate to the directory of the folder in command prompt and type "ruby (file name that is .rb)" then press enter I get that error message in the title. Why won't my command prompt open the .rb file even when doing so manually from command prompt when I have ruby installed? |
An "yml" config file doesn't exist after deploying to heroku Posted: 29 Aug 2016 07:03 AM PDT Rails 3.2 On localhost it works, on heroku not: The error is But the file is in the repo. |
What is the best way to share a text file between cluster nodes? Posted: 29 Aug 2016 06:51 AM PDT The chef recipe creates a text file on one node which is the used by two other nodes. I am thinking of storing the text file in an encrypted data bag when it is generated on the first node. The encrypted data bag is then loaded on the 2 other nodes. I am trying to use the following post as a reference: how to create\edit encrypted data bag item from a chef recipe Please suggest if it is correct way to share the text file on 2 other nodes after it is generated on the 1st node. |
Pubnub going to stuck after publish some messages Posted: 29 Aug 2016 06:45 AM PDT Pubnub going to stuck after publish some messages, it is working fine for some messages but stuck after a limit. |
How to add price upon checking a check_box in Ruby on Rails Posted: 29 Aug 2016 06:52 AM PDT I am working on a paid ad job board, and am using #Payola-Payments (Implementation of Stripe Payment Processor with Rails Application) to charge each job post on the app.. This is what I like to do:
Pictorial explanation of what I like to do: Upon checking the box, it's suppose to add $20 to my default price in jobs table. schema.rb Note: A price default of $200 in cents (i.e. 20000) is set in my jobs table. The reason being what is required in Payola-payments documentation. So anytime anyone posts job advert, $200 will be deducted from his/her credit card by Stripe. What I have done to solve this: I defined a method inside my model (job.rb) called Thanks in advance. Am using |
rails each method reset in controller workaround Posted: 29 Aug 2016 06:01 AM PDT So i have this in my controller at the moment: Basically all this is doing is selecting the most popular events that are saved in the impressions table and getting all the event information. So in my view i have this: I was expecting to see around 4-5 event names here, However i'm only seeing 1. I'm guessing its because the @events is getting reset? What would be the work around for this? Sam |
MySQL Regular expressions: How to match digits in the string with \d? Posted: 29 Aug 2016 06:14 AM PDT I have a column I want to find all the records based on given month and year but with any date. Tried following but did not work for me, When I try same thing with following by giving direct date, it works fine. Note:- I am using Your help is much appreciated! |
Want to schedule a task on every 2 hours from 8am to 12pm on heroku through scheduler add on Posted: 29 Aug 2016 06:58 AM PDT I want to create a task that run on every 2 hours from morning 8 to midnight. I have created task and tested locally , when i made a job through scheduler it just gives me three times daily , hourly and every 10 min. How can i customize it. |
tests failing after change default timezone for activerecord Posted: 29 Aug 2016 05:51 AM PDT I have the following method: and in my controller, I do this
I also have the following test to make sure that the user is being tracked correctly: until now, it was passing perfectly.
after I added this line, this test is now failing. there is no |
Rails/Sqlite 3 - Displaying table data on page Posted: 29 Aug 2016 06:55 AM PDT I'm very very very new to Rails, and I've got a fast approaching deadline to code my first rail app as part of a challenge. I've so far created the basic blog application, to get my head around how rails works. I need to display a list of all data held within a table on a page in my site. In blog, I've got an index page - which lists all blog posts so I've been trying to follow the same process. I've created a populated table in my database, and a controller - but when I try and display info from that database on my page I get the following error: uninitialized constant RecordsController::Aliens All I want to achieve is a simple table, which has the list of my records in, so far I'm not having much luck retrieving the data from the database. Any help appreciated! |
How to create functional test for Ruby on Rails Posted: 29 Aug 2016 05:36 AM PDT What is the best way create tests that include:
for Ruby on Rails test environment? |
Rails joining tables having has_many association Posted: 29 Aug 2016 05:55 AM PDT I have Student and Record table with a simple has_many :through association: I need to fetch all students details of MBA branch. I need to assign result to a variable @students and need to access record of a student using That is I need to access has_many related class datas also into an object. How to write query for that. I am newbee in rails. Please help .Thanks in advance |
Error sending emails with Rails 4 & Devise (connection refused, port 25) Posted: 29 Aug 2016 05:40 AM PDT I'be been having some massive issues getting emails to send. I've tried multiple ways of doing things; using gmail, mailgun, sendgrid, the mailgun gem etc, no luck at all. For some reason it's trying to send using port 25 although, as you can see below, I'm specifying port 587. The error I get is: Errno::ECONNREFUSED (Connection refused - connect(2) for "localhost" port 25): My development.rb file is as follows: I have looked around for solutions however none seem to solve the issue. I'm totally out of ideas. |
Add more markers to markerCluster without removing previous Posted: 29 Aug 2016 05:11 AM PDT I build a map and add markers. When I'm calling |
Query in Ruby on Rails 4 to make a selection based on the current user Posted: 29 Aug 2016 05:41 AM PDT I am new to Ruby on Rails and try to make the right query. But after reading the documentation and examples I don't manage to get the right query out of it. So I hope someone can point me in the right direction. Situation I build an app where trainers can setup trainings, and give these trainings on several dates (the dates are called thrills), other users can subscribe for these thrills. It has the following structure: models and needed table. My models code looks like this:
I was thinking of something like this: or or But unfortunately none of them works. Does someone have an idea how to solve this? Thanks in advance! |
Getting text only when nokogiri certain HTML structure Posted: 29 Aug 2016 05:26 AM PDT I've been struggling with nokogiri lib in order to fetch (scrape) content from web, I failed to understand how to get only text without nested tags. Here is what I parse Here is the way I scrape it the gsub at the end does almost exactly I need, but I lefts number of whitespaces after. Can anybody suggest the best way to get only "text I need" from the above example please? |
Rails and MQTT: Subscribe to topic in background at server startup? Posted: 29 Aug 2016 06:27 AM PDT I want to subscribe to a mqtt topic in my rails app when the server starts and and keep the subscription always active and running. I'm using this mqtt gem for mqtt communication: https://github.com/njh/ruby-mqtt Here is what I have right now: in application.rb: BackgroundMQTT class: So basically the mqtt subscription starts in the Also As you can see, I'm running the subscription in a Thread, otherwise my rails application would stop doing anything else than listening to the mqtt subscription. This seems to work at least for the first couple of minutes. I'm not sure if this is a recommended way of doing what I want to do. Could this cause any issues that I haven't considered? What would be a recommend way of doing this? |
Posted: 29 Aug 2016 05:41 AM PDT I'm trying to create a one time, single charge in Stripe with Rails. I am getting the following error: However, as can clearly be seen in the photo, the token is in the parameters. That token is from Stripe.js. Here is my code in my controller: I have also tried: And that does not work either. All of this is simple, boilerplate code straight from the Stripe site, any idea what I could be doing wrong? I'm not having any trouble with the Stripe embedded form. |
Can't modify frozen hash. Rails 4.1 and SSE Posted: 29 Aug 2016 04:42 AM PDT I am trying to implement SSE in rails 4.1.16 with ActionController::Live. But I am consistently getting end My error back trace is - Thanks in advance for the help. |
rails devise undefined method username when I want to use it with cancancan Posted: 29 Aug 2016 07:22 AM PDT I want to achieve a role based authorisation in rails. for login I use the gem devise, which works perfect. but after I am including some code of cancancan like in this tutorial I get an error undefined method username and when I remove username I get an error undefined method email... here is my code: ability.rb (to manage what a user with a specific role can do) a part of my user.rb a part of my application_controller.rb I really can't get whats wrong... I thought that I have to set @user like @role in user.rb but it doesn't helped |
How to call rails api using parameter Posted: 29 Aug 2016 04:29 AM PDT I am trying to call api with parameter can anyone please help me to call the api with the parameter passed using user id and converted image. here is the code for controller which i tried so far: |
f.select not preselecting value while editing Posted: 29 Aug 2016 07:10 AM PDT I have a field but while editing the form it doesn't preselect the current value of I know I can pass OR But as this guide suggest I don't need to use those options Can anyone tell me what am I doing wrong? NOTE: It's a nested attribute and other fields are working fine with |
Ruby on Rails - Show only 3 image pr page Posted: 29 Aug 2016 07:07 AM PDT In my application, I have Currently, in my How can I show only 3 Example: A post has 20 slides, It only show 3 slide per page with a Next button to the next 3 etc and the URL would for instance be This is what I have done now:
in with_pagination view in routes in controller Now I can show all the slide on that page, but as mentioned I only want to show 3 slides pr page with a next and prev link to them. Ps: I have had almost the same question before but it doesn't work as the same since other one was with use of pagination and pagination is not what I am looking for |
Send email out after new employee registered by overriding Devise Registrations controller Posted: 29 Aug 2016 07:27 AM PDT Rails 4.2 Devise I would like to send out a welcome email to newly registered employees. I have the following overridden Devise Registrations Controller: This works, however I don't think its correct as I have to test if the resource is valid otherwise the system tries to send out emails even for submissions with invalid data. Is this the correct way of doing this or how should I make sure only a resource that is saved to the database will be used to send out an email? |
ajax call to changes drop down on basis of other drop down rails Posted: 29 Aug 2016 03:44 AM PDT I have followed this approach to change one drop down on the bases of other (ajax based). In index.slim I have and ajax call is like I have also created seating_change.js.erb and in Controller If I try to alert in success of ajax call it has the data which I desire for but the second drop down remains same. What 'm I doing wrong |
Send xlsx file to front end - AngularJS Posted: 29 Aug 2016 07:38 AM PDT I want to send xlsx file created by rubyXL gem to front end, which is AngularJS. When I save worksheet in a stream and send it by send_data method, I get the data, but I can't open the created document because it is broken. I am able to save the data to disk. But I can't be able to send it to client side. so, that I can access the data from angularjs. I don't want to save the workbook on cloud and send a link to the client side. What is the best solution of my problem? Where I make mistake? UPD: It seems when I trying to send saved file, I delete file before sending completes. UPD: When I am sending data, I have problems with encoding data. I tried to use |
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