Modifying the request protocol in RSpec 3.5 | Fixed issues |
- Modifying the request protocol in RSpec 3.5
- Rails 5 deprecation warning and adding code to initializers?
- Why are null values in your tables a bad thing to have?
- Rails remove time from datetime attribute and group
- Rails: storing static lookup types/constants outside database
- How to publish and implement Ruby file to my website
- Select records where many-to-many relationship is empty
- rails: how to filter a response/request json parameters when logging done by a gem?
- Rails Paperclip to Carrierwave - Carrierwave trying to process images on request
- ember not communicating with rails
- Capybara with Chrome driver, all specs are crashing with EOFError: end of file reached
- How to add multiple images with ActiveAdmin?
- Rails Gem for Searching
- Ruby has_many without destroy
- Rails javascript buttons causing post
- How to sync activerecord clock with mysql server clock instead of the server clock hosting the app?
- Rails 5 Pivot Table or alternative approach
- ActiveRecord multiple custom length validation
- assets folder(images,stylesheets,javascripts files) is not working properly on the server in ruby on rails
- Adding custom field to devise User model error
- How to get data of last 24 hours on top in rails
- Repository not found. Using capistrano and privare repository in team
- How a Rails web service can send informations to an application?
- How to patch rails built in model generators?
- Radio buttons in rails not taking default value based on the data stored in the database
- how can I set one column in database when one user sign_out with devise
- Footer Causing a second Page to appear
- create relationships for STI child
- Rails 5, Added action controller don't render correctly
- jQuery hover: does not work for each instance of ".map"
Modifying the request protocol in RSpec 3.5 Posted: 28 Oct 2016 08:27 AM PDT I'm trying to modify the protocol of the request my controller test sends my server to be 'https://'. This is what I have so far: and in my controller: I've tried adding and to the post request (as per Modifying the request protocol in RSpec 3.5), but I've not been able to get it to work. Any help would be much appreciated! |
Rails 5 deprecation warning and adding code to initializers? Posted: 28 Oct 2016 08:14 AM PDT To which initializer file should I add the desired line of code? I'm getting the following deprecation warning. DEPRECATION WARNING: Time columns will become time zone aware in Rails 5.1. This still causes To keep the old behavior, you must add the following to your initializer: To silence this deprecation warning, add the following: I'm a rails newbie, I just want to follow best practice. Thanks! |
Why are null values in your tables a bad thing to have? Posted: 28 Oct 2016 08:07 AM PDT I'm reading a post about single table inheritance and polymorphism in Rails and I came across this sentence:
Why is having null values in your table cells a bad thing? Does it take up memory? Does it slow down queries? What makes it bad? |
Rails remove time from datetime attribute and group Posted: 28 Oct 2016 08:06 AM PDT I have a column DATENEW in my invoices table. If in my view I use: it shows: I need to display only year month and day. And I also need to group by DATENEW. So time should not be considered when grouping. How can I do it? |
Rails: storing static lookup types/constants outside database Posted: 28 Oct 2016 08:13 AM PDT I have static lookups that are used to populate form fields as well as validate attributes. I'm not storing them in the database because they are static and will not change, and core application logic is based upon the values (don't want a DB value change breaking the application). I have several options that are viable, but am not sure which one is the most conventional or may cause problems. What's the Rails convention for static constants like this?
I'm a little confused because any of them will work, but I'm sure there are some unexpected side-effects I'm not considering. |
How to publish and implement Ruby file to my website Posted: 28 Oct 2016 07:42 AM PDT I'm a beginner of Ruby. I want to establish my website by programming with Ruby language. Before that, I used to upload HTML files to my web-host server, so that I could update my website. But now I have no idea about what should I do with Ruby file. Thank you! |
Select records where many-to-many relationship is empty Posted: 28 Oct 2016 07:37 AM PDT I have a many-to-many relationship between I have my folders table structured with Now, when I share a folder with an user (create a I also had a pair index to make sure one p/s: descendants of a folder can be query by just |
rails: how to filter a response/request json parameters when logging done by a gem? Posted: 28 Oct 2016 07:31 AM PDT In a rails application I am using gem called active_shipping this gem logs API response/request internally. Problem begins when I save the logs to file system with passwords I pass on request... (rails doesn't filter by the regular filter mechanism) Anyway filtering this json request logs? Thanks |
Rails Paperclip to Carrierwave - Carrierwave trying to process images on request Posted: 28 Oct 2016 07:30 AM PDT I have some images on amazon s3. A rails app was accessing them through paperclip. I've migrated to carrierwave. For some reason, using something like: in the carrierwave Uploader is making carrierwave attempt to (I think, I can't see anything in the logs) process these images when requesting them, which is obviously not ideal as it's taking minutes to display an image. f I remove the processing from the Uploader, then they're loading instantly, as they should. Why is this happening? The Uploader should only process new images that are being uploaded, am I correct? What on earth is it trying to do... |
ember not communicating with rails Posted: 28 Oct 2016 08:34 AM PDT I am following the tutorial at Ember and Rails 5 with JSON API: A Modern Bridge. Thus, I now have a rails-api for backend and ember for front end. I started the rails server as suggested:
Started the ember server:
I had to specify a port for creating the Ember server though, because I got an error saying:
It seems as the rails backend work as if it is suppose to. When I visited http://localhost/something.json I get the proper json response. In the tutorial they ask you to visit the ember frontend open ember inspector, console and enter the command :
The response I get is:
I am using c9 with this tutorial, not sure if it has anything to do with it though. The question is, Why am I getting this Error? I Am new to stackoverflow, Rails and Ember. I have searched the question and the solutions posted did not work for me. |
Capybara with Chrome driver, all specs are crashing with EOFError: end of file reached Posted: 28 Oct 2016 07:58 AM PDT Capybara using Chrome driver with setup: spec_helper I appear to be getting On all of my Javascript tests when I run them with chrome driver. Running with poltergeist they work fine. • also when they crash they appear to open multiple instances of chrome which hang (but do not exit) see http://screencast.com/t/Worwl9d6Iuhr screenshot example • these appear to affect only my javascript specs (:js => true in Capybara) • Rebooting my machine did not solve the problem • Reboot did not help • My Chrome Mac OS X is currently at 54.0.2840.71 • I'm not sure when sub-sub-point version 71 got released since of course Chrome doesn't tell you or even seem to have it available in some kind of update history. The public information says sub-point version 54.0.2840 was released 2016-10-12 but it doesn't specify when sub-sub-point version 71 was released • I can reproduce the effect on both my code on master, as well, I have a specific memory of running these specs with Chrome driver earlier in this week, so I am strongly suspecting that Chrome did a sub-sub-point release here and broke this. if anyone else can confirm I would appreciate it. otherwise, if I find a local problem, I will post answer here. • Capybara 2.7.1 • selenium-webdriver 2.53.0 • I located the Chromedriver executable in my machine at
|
How to add multiple images with ActiveAdmin? Posted: 28 Oct 2016 07:11 AM PDT what I am doing wrong? and my view |
Posted: 28 Oct 2016 08:32 AM PDT I have a webapp where I want to provide an advanced search in which the user enters an arbitrary amount of queries joined by AND's and/or OR's, like this: (entered into the search box on the webpage) In a prior post, I successfully implemented a system in which I directly convert queries formatted as above into valid SQL statements, and feed them straight into SQL to query the database. This worked, but now I worry about three things:
Well, I've heard there is a better way, by using search gems. However, I've been having trouble finding gems that match my needs. Many of the gems seem too complex for what I need, and nothing that I've found made it clear exactly how you could implement specifically what I'm looking for -- where the user enters a dynamic number of queries joined by AND / OR statements. Exactly how costly is it to just convert the statement straight to SQL syntax and inject it right in, like I'm doing right now? How easy is it to incorporate one of these gems for what I want? What would an "experienced" Rails developer do? I'm a complete noobie to Rails, so I don't have experience with any of this. |
Posted: 28 Oct 2016 06:36 AM PDT I'm facing a model problem. I've 3 models : User, Address and Residence User: Address end Residence: The problem is when I want to delete a User or a Residence The system failed to delete residence due to a foreign key and the system said to me that cannot be done because still reference to residence in adresses table. I don't want to delete address linked to Residence when I delete residence, address should only be delete bu user deletion (that's why i try to use Need I to use a join table instead of references between residences and addresses? Thanks |
Rails javascript buttons causing post Posted: 28 Oct 2016 08:18 AM PDT I've created a form where a user can move items from the left side to the right side using two buttons. After the user has finished adding their items they can name & save the group. At least that's how it's supposed to work. Instead, as soon as I add one item, and click on the 'move right' button the POST action fires. Why are my javascript driven buttons firing the POST action instead of the Here's what the form looks like The form code in the view: In my controller for loading the view The POST action is calling And my routes are: |
How to sync activerecord clock with mysql server clock instead of the server clock hosting the app? Posted: 28 Oct 2016 06:48 AM PDT Like many of you, we have many (equivalent) servers in production to handle large traffic. For a reason i dont need to explain, our servers are completely closed for the outside world, even for access on ntp ports in order to sync time. So i need to hack the rails app to get time not from the server hosting it, but from the one hosting our common database, so that timestamps (created_at / updated_at) can stand logic. Any idea how to do that ? |
Rails 5 Pivot Table or alternative approach Posted: 28 Oct 2016 05:49 AM PDT My database table STOCKMOVEMENTS ID, PRODUCT, QUANTITY, REASON 1 | Product1 | 2 | 1 2 | Product2 | 3 | 1 3 | Product1 | -1 | -1 4 | Product2 | -2 | -1 5 | Product2 | 4 | 1 Column reason is the movement type. -1 corresponds to a sale, 1 corresponds to a purchase. Table need to be grouped by product and sum units. I want to achieve PRODUCT SOLD PURCHASED Product1 | 1 | 1 | Product2 | 2 | 7 | I understand that this is the case when a pivot table should be used. But I also need to show in table other columns like product.category.NAME (from a join with products table). But looking at the documentation I can't find out how to to it. Question1 - Should I use a pivot table or use a different approach? Question 2 - A solution that seems to me logic and simple would be create a scope or a method sold (and purchased) and then call in my table something like: To achieve that I'd need
and
But I don't really know how to do it. Mostly for the where clause. Is something like this possible at all? If someone could point me in the right direction would be great. Thanks! |
ActiveRecord multiple custom length validation Posted: 28 Oct 2016 06:18 AM PDT I have an For example:
And so on... I'm running Ruby on Rails 4.2.7. |
Posted: 28 Oct 2016 06:09 AM PDT i am new in ruby on rails, i have done some modification in assets file ( like add a new image file default2.png,some style file has be changed and some javascript file also changed). I have uploaded all file on the server in assets folder then tried to precompile all assets with the help of following command rake assets:precompile and also tried rake assets:precompile RAILS_ENV= production after that css was not working properly check box is not visible, some images are not displaying in page. we try to rollback the precompile file using these steps
again we tried the rake assets:precompile and rake assets:precompile RAILS_ENV= production. Problem is not resolved, i had tried with below links database configuration does not specify adapter Rollback rake assets:precompile rails 4 asset pipeline vendor assets images are not being precompiled then got error **config.eager_load is set to nil. Please update your config/environments/*.rb fil es accordingly:
rake aborted! ActiveRecord::AdapterNotSpecified: '' database is not configured. Available: ["d efault", "development", "staging", "production"] ** |
Adding custom field to devise User model error Posted: 28 Oct 2016 07:06 AM PDT i'm adding a full_name (string) value to my model User, using gem Devise. And also Everything should work, but I've got an error when creating user Any ideas? |
How to get data of last 24 hours on top in rails Posted: 28 Oct 2016 05:31 AM PDT There is a model I try But by this PM all posts on top. I want PM posts of only last 24 hours on top. |
Repository not found. Using capistrano and privare repository in team Posted: 28 Oct 2016 05:16 AM PDT I have problems using the (deploy key) with capistrano, just after adding my private repositories to a team of github. I leave my setup, any suggestions? Maybe is a setup in github, but i dont have idea. |
How a Rails web service can send informations to an application? Posted: 28 Oct 2016 05:11 AM PDT Usually, we use applications to consume web services methods. But in the other case, I mean when we need web services to send informations to our application without the app first contacts the web service. How can we do ? I have thought to use Ruby Sockets (from my Rails app) to interact with Swift Sockets (of my Cocoa application), but is it the best way to do that ? Or perhaps there is another way that is more neat ? |
How to patch rails built in model generators? Posted: 28 Oct 2016 05:39 AM PDT I'm in the situation where I want to add another field to every model that I create with How can I reopen this generator and add a field |
Radio buttons in rails not taking default value based on the data stored in the database Posted: 28 Oct 2016 04:47 AM PDT Am trying to create a profile page where the user can check "male" or "female". After saving the form, whenever the user visits the page again, the gender must be set by default based on the data stored in the database. Am using the form_for helper here. |
how can I set one column in database when one user sign_out with devise Posted: 28 Oct 2016 04:50 AM PDT I set one column called |
Footer Causing a second Page to appear Posted: 28 Oct 2016 04:04 AM PDT I'm working on a project that uses wicked_pdf, I have a footer partial which I reference in the pdf generation with: For some reason when I have the footer there it causes an extra page to appear on the invoice. So a one page document has a second blank page with a footer |
create relationships for STI child Posted: 28 Oct 2016 05:17 AM PDT I have User, Teacher and ClassRomm model using STI as following my question how can i create migration for all relationships between user,teacher,Student and classRooms ? for example should class_rooms has forignKey column for instructor_id or user_id |
Rails 5, Added action controller don't render correctly Posted: 28 Oct 2016 03:05 AM PDT I've added two new actions at my controller users and the route in route.rb Also in users views i've added the pages Now, if i browse Really i don't understand. |
jQuery hover: does not work for each instance of ".map" Posted: 28 Oct 2016 02:57 AM PDT So in my index view i have this (shortened to show the important part) And here's the script So the problem i have is that on the first instance of the image, the How do i make it such that for each instance of the image, the |
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