Rails 4.2 Clickable simple_calendar doesn't work on the other date than the current date | Fixed issues |
- Rails 4.2 Clickable simple_calendar doesn't work on the other date than the current date
- Should I test associations between models?
- Run rails application On Azure VM
- how to override devise sign_up method
- bad URI(is not URI?): only in production using ruby 2.3, rails 4.1.7 deploying on heroku
- Heroku setup that would support 3-5 Million visitors per hour
- deploy rails app digital ocean server
- selecting distinct first by one field
- How can I create wrapper for the types in the simple_form gem?
- Sendgrid returns SMTP-AUTH requested but missing user name
- Rails Won't Render My View
- Rails app on existing database encoding error
- Rails - Formats and Rendering - How do they work?
- Association among three model
- after_update callback won't update attribute
- vk sharing dollar sign
- Update attribute from other model
- How to show the accumulative push notification instead of showing multiple notifications that tend to appear at the same time?
- Moving servers effect my SEO
- Is there a PG issue with multiple AJAX submissions in a Rails Rspec test?
- Parsing a string of varying nested data structures
- Image upload using carrierwave in show page
- Neither PUB key nor PRIV key: nested asn1 erro
- Active record for sql
- Create device fingerprint for Ios - Rails
- mariadb with rails: can't install libmysqlclient-dev
- Oracle TNS error with Ruby on Rails Rake command
- How in factorygirls create two objects Freelancer and User after creting object User, with id = user.id?
- Rails and devise - testing controller when signed in and signed out
- How to check if table is empty during metadata lock in mysql
Rails 4.2 Clickable simple_calendar doesn't work on the other date than the current date Posted: 21 Apr 2016 06:47 AM PDT Good day guys. I am new to rails, currently building a clickable calendar with simple calendar gem for booking purpose, that I can click on certain date on the calendar, it will pass the date to my new_booking_path. I went through this post --> Rails 4 x simple_calendar gem: create new record on click in calendar cell and the function only works for the date shown when you first load the page. What's going on? Following are part of my codes. In my index page: bookings_controller.rb Please help, thanks!! |
Should I test associations between models? Posted: 21 Apr 2016 06:42 AM PDT Should I write a test for an association between two models? I just found this code in one of my first Rails projects and this doesn't seem correct as not having the association causes an error rather than a failure. So how and where would I test them correctly? |
Run rails application On Azure VM Posted: 21 Apr 2016 06:24 AM PDT Recently we've analized the idea of migrating from Heroku to Azure for the deployment of our application. I've managed to set up the VM and the basic example they give of running a rails app and the server works fine and I can connect. When trying to migrate our project and running the server (with rails s -b 0.0.0.0) from the Azure VM, this message is shown in the browser:
The thing is, usually when running locally I connect to localhost:3000 (I just run rails s). If I try to run the server like that on the VM, I get:
Am I missing some configuration from the VM or maybe it is from my application? |
how to override devise sign_up method Posted: 21 Apr 2016 06:54 AM PDT I want the thing like that, when a user is registered by an admin using the devise signup views, the user shouldn't be kept in the session. By default the devise keep the user in the session using the following method in the registration controller. Now, how I can override this method from my registration controller that is inherited from the devise registration controller? My registration controller codes are like as |
bad URI(is not URI?): only in production using ruby 2.3, rails 4.1.7 deploying on heroku Posted: 21 Apr 2016 06:48 AM PDT I tried to put in production my website. But when my URI is called by the app, I have the following message
When I'm running the app on localhost it's working but when I running the app on production it doesn't work at all. How can I solve this problème, I already tried :
Thanks for your help. |
Heroku setup that would support 3-5 Million visitors per hour Posted: 21 Apr 2016 05:45 AM PDT A post on the Reddit front page will gather as many as 30 million to 50 million page views. All of that within 24 hours, and perhaps only within 10 to 12 hours. So, there could be 3 to 5 million visitors per hour. Say 3.6 mil per hour, that's 1000 visitors/second. Our website: ruby on rails + postgres app that allows user registration (devise) and renders a simple page with a YouTube video embed. Assuming an unlimited budget, approximately what Heroku setup would be able to handle the traffic? What's the likely bottleneck (db connections? concurrent requests?) |
deploy rails app digital ocean server Posted: 21 Apr 2016 05:38 AM PDT I am bit new to rails but somehow I manage to make an rails app. Now I want to deploy it to Digital Ocean server. All I got is 1- complete ruby on rails app 2- IP for digital ocean 3- Username 4- Password can someone tell me steps to deploy it and which tools to use? (I used fireFTP and Filezella for changing in some existing apps, but not sure that they are useful here or not) |
selecting distinct first by one field Posted: 21 Apr 2016 07:01 AM PDT I have a But I'm damn sure there is a more elegant and faster way of doing it especially when the number of works gets bigger. |
How can I create wrapper for the types in the simple_form gem? Posted: 21 Apr 2016 05:09 AM PDT I want to create a wrapper for my app, but html for different types should be different. So, I can write just so, my initializer will contain definitions for both How can I do that? |
Sendgrid returns SMTP-AUTH requested but missing user name Posted: 21 Apr 2016 05:08 AM PDT I am new to ruby on rails and I follow the book Learn-ruby-on-rails by Daniel Kehoe. I have set up my sengrid login details correctly on the Ubuntu enviroment. echo $ SENDGRID_USERNAME returns my username correctly. However, I still get "SMTP-AUTH requested but missing user name" error when I submit the contact form. I have tried to hardcode the login details and I still get the same errors. my configuration settings i smtp.sendgrid.net on port 587 and I allow send mails in development. Please what am I not doing right. Thanks a lot. My user_mailer.rb is as shown: end while the contacts_controller.rb is shown below: end |
Posted: 21 Apr 2016 05:05 AM PDT I'm running devise with custom views, and my I don't get an error, my layout renders perfectly, but it doesn't yield the body for some reason. Code Here's my Here's my Here's my view: Log |
Rails app on existing database encoding error Posted: 21 Apr 2016 04:57 AM PDT I'm making an app on existing database in firebird with charset windows-1250. |
Rails - Formats and Rendering - How do they work? Posted: 21 Apr 2016 05:18 AM PDT From what I understand, calling If the response is html, the browser just renders the page. If the response is json, usually, the client js code takes the json response and does something useful with it. If the response is js, what would the browser do? I am not sure if this js is appended to the document and executed? Is this related to Rails UJS? Also, how is render related to respond_to? Are they used side by side, or is one preferred over the other? Sorry if this may seem like a lot of questions, but I think it would help if these questions were discussed together. |
Posted: 21 Apr 2016 04:52 AM PDT I have these models with association as follows Comment has Now if i write this code is console This would create a comment but |
after_update callback won't update attribute Posted: 21 Apr 2016 04:55 AM PDT Good day... I have implemented an after_update callback for a specific column that will be updated, and after that column is updated the callback is meant to add the newly updated value to another column i.e When i run rails console and run "Product.update produced:450" the stock column will automatically add the new value. i.e it works perfectly but when I try updating from the "view/controller" it doesn't work at all. please is there a reason why? 2.2.4 :004 > h => Product id: 1, name: "MAC Air Filter", partnumber: 33440, description: "Air filter", stock: 3440, created_at: "2016-04-08 11:38:58", updated_at: "2016-04-19 20:33:00", produced: 33 2.2.4 :006 > h.update produced:3000 (0.1ms) SAVEPOINT active_record_1 SQL (1.4ms) UPDATE "products" SET "produced" = ?, "updated_at" = ? WHERE "products"."id" = ? [["produced", 3000], ["updated_at", "2016-04-20 13:57:59.377954"], ["id", 1]] (0.1ms) RELEASE SAVEPOINT active_record_1 => true 2.2.4 :007 > h => Product id: 1, name: "MAC Air Filter", partnumber: 33440, description: "Air filter", stock: 6440, created_at: "2016-04-08 11:38:58", updated_at: "2016-04-20 13:57:59", produced: 3000> |
Posted: 21 Apr 2016 04:36 AM PDT I have vk sharing button in my rails app it works great but one tiny problem with my js On preview screen it looks like raw html code |
Update attribute from other model Posted: 21 Apr 2016 04:45 AM PDT I'm creating an app in Ruby on Rails to store played football games. Each user has to join or create a league to keep the scoreboard private between friends. When creating a league I want the creator to autojoin the created league. Controller: So in the create action I'm looking for the current_user trough the private method find_user, then I'm updating the field league_id and then I'm saving this value. However when creating a new league the autojoin didn't work. What am I doing wrong here? |
Posted: 21 Apr 2016 04:52 AM PDT Whenever a new event is added, a push notification is sent to the user. If ten events are added in row, ten push notifications will be sent to the user, a behavior that will be annoying. I'd like to have it like this: if ten events are added in row, or added very near to each other regarding time, only one push notification will be sent to each user, saying: Here's what I've done so far: Added a field If a new created event is in the 2 minutes radius of The only disadvantage to this problem is: as an event is added, the notification won't be sent right away. There will be a delay of 2 minutes. Is there any design patter or optimum solution that could better do this job? |
Posted: 21 Apr 2016 04:35 AM PDT Just a question our old website is on Ruby on Rails with another server than Go Daddy (Domain is with go daddy), i rewrote the application in php and would like to move this back to go daddy will this effect my SEO ?. |
Is there a PG issue with multiple AJAX submissions in a Rails Rspec test? Posted: 21 Apr 2016 04:22 AM PDT I'm running integration tests on my Rails app using a PG database, Rspec, Capybara and the poltergeist gem for javascript submissions. Essentially I'm testing the flow/presentation of questions in a question tree - and in my rspec tests I click and answer, submit via AJAX, then test that the correct next_question is appearing. This works fine when testing 1/2 questions deep, but once I start submitting >3 questions in series using JS, I get the following error: I'm also seeing: Errors like this crop up, which don't if I remove the offending deep js submissions. Here's the code that fails: Is this caused by the number of AJAX submissions in series? If so, how would I test this (at first glance it seems I can test the submit button, but I'd need to build a series of answers in FactoryGirl and then test the view rather than using |
Parsing a string of varying nested data structures Posted: 21 Apr 2016 05:55 AM PDT I have a method that parses a string value and converts it into a selected data type, but I am having difficulty converting strings with nested data structures, eg: Currently I convert using the eval method but this causes a massive security issue because the string is actually input by a user. Is there a different way in which I can parse these types of string? I have tried JSON.parse but it doesn't like the nested hash inside of the array. |
Image upload using carrierwave in show page Posted: 21 Apr 2016 04:10 AM PDT Using Rails 4 and Ruby 2.2, I have book as model which should have image upload functionality in the show page of book. So User can create the book first and from show page upload the multiple images for book. I have used carrierwave as gem and have separate model created for Image.
Now I am kind of unable to proceed with this, can someone guide me on this because I am having form in books/show page and I need to show the image on the same page after successful updation of images.(Multiple images can be uploaded) Thanks in advance let me know if I need to provide any more information. |
Neither PUB key nor PRIV key: nested asn1 erro Posted: 21 Apr 2016 04:33 AM PDT I am getting An |
Posted: 21 Apr 2016 04:22 AM PDT Please help i need ruby active record query for this sql: |
Create device fingerprint for Ios - Rails Posted: 21 Apr 2016 03:44 AM PDT Have to create a Fingerprint for Ios Device. I have used, It is generating fingerprint based on brower. But i need fingerprint only based on device data not based on browser Is there any other way to do it. |
mariadb with rails: can't install libmysqlclient-dev Posted: 21 Apr 2016 03:39 AM PDT I have mariadb-10.1 installed on a stock 64bit Ubuntu 15:10. I have libmysqlclient18 succesfully installed, but I get errors when trying to install libmysqlclient-dev. Can anyone suggest how to resolve this? Thanks :-) Steve |
Oracle TNS error with Ruby on Rails Rake command Posted: 21 Apr 2016 06:24 AM PDT I am trying to use the Ruby on Rails Rake command to migrate to an Oracle database. My On my PC I have set When I run Rake,migrate, I get the following error: Can you tell me if I need to modify my The output of the lsnrctl Status command is as follows: Can anyone help / make a suggestion? |
Posted: 21 Apr 2016 03:26 AM PDT How in factorygirls create two objects Freelancer and User after creting object User, with id = user.id? In test I am calling: Freelancer is creating ok, but how create photo with id = user.id and photo belongs_to freelancer? |
Rails and devise - testing controller when signed in and signed out Posted: 21 Apr 2016 04:16 AM PDT So I want to test controller which is using devise. I followed this guide from devise wiki. So I created ControllerMacros module as you can see here: And included it, and other needed things to rails_helper: Here is admin factory: But now I don't know how to sign out admin? As sign_in_admin is executing before each test, but I need to sign admin out for some of the tests. What is the best way to test this controller with signed in/out admin? btw I'm kinda new to testing |
How to check if table is empty during metadata lock in mysql Posted: 21 Apr 2016 03:09 AM PDT I need to maintain ping service that has to check if particular table is empty every 20 seconds. However, from time to time a script performs work on that table which results in metadata lock. This script can sometimes run for hours. This results in ping requests falling into "waiting for metadata lock" state and piling up very fast. Sometimes this results in "too many connections" error. My question is: is there a way to check if table is empty, that does not care if there is a lock? If not, what other solutions are possible? I am using Rails 3.2 with RDS mysql. |
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