ActiveRecord's query misbehavior for outer joins? | Fixed issues |
- ActiveRecord's query misbehavior for outer joins?
- JBuilder/Rails 5: return simple string instead of json object
- Why it's useful to create RVM gemset for rails project
- redirect rails id show method to rails permalink
- Table showing the result of queries using rails
- Rails 5 missing template that was added to lookup
- Heroku run rake db:migrate error when trying to deploy
- Added Column Not accessible in next migration file
- Dynamically mount Carrierwave uploader on serialized field
- Not able to connect mongodb with Rails container using Docker compose
- How to properly load lib modules and classes in Rails 5 app
- Model name and path after routing in Rails
- Ruby on Rails, taking data from Graphql and posting on it to Facebook-messenger
- Different versions of the index page for ActiveAdmin
- How to define let! with mutliple objects in Rspec test?
- How to get access token and refresh token from google api?
- Displaying and Creating multiple entities rails
- Update rails with amazon cloudfront and test rails
- How can I prepare my rails app for production?
- MySQL/Rails - Mysql2::Error (Access denied for user 'rails_user'@'localhost' to database 'simple_cms_development'):
- Form submission within render partial is showing errors for all forms on all objects
- Rails 5 display number of results when grouped
- Skipping Active Record breaks Rails Generator
- flash[:notice] is throwing error when I use Ruby 1.9 with Rails 2.3.4
- ElasticSearch: Altering indexed version of text
- Split youtube url rails
- Rails root test
- In Ruby, What exactly is the difference between RVM, Bundler and Rake?
- Big discrepancy in ruby Time arithmetic used with active support Time extensions
- Rails 5 has many through association with fields_for - How write the form and controller?
ActiveRecord's query misbehavior for outer joins? Posted: 23 Oct 2016 07:33 AM PDT Lets have two ActiveRecord models Building query with outer join and alias for joined table column produces following invalid SQL: Execution results in database error: As you can see, ActiveRecord injects invalid Above misbehavior is related to simultaneous use of Can anybody explain this behaviour ? Candidate for a bugreport or am I missing something ? tested with ActiveRecord ver. 4.2.7.1 |
JBuilder/Rails 5: return simple string instead of json object Posted: 23 Oct 2016 06:33 AM PDT using jbuilder and rails 5, is it possible to transform a model object into a simple string, for example with this object: using instead of: the idea is that the index action of my controller returns an array of strings instead of an array of objects not The scaffolded contents of I tried but the result is empty. How to do this with jbuilder? |
Why it's useful to create RVM gemset for rails project Posted: 23 Oct 2016 06:29 AM PDT It's recommended to create a separate RVM gemset for each rails project. But I don't understand, why it's useful. Are there only aesthetics reasons? Because it is possible to install multiple gem versions globally and then write a version in Gemfile in case I need a specific version of a gem. |
redirect rails id show method to rails permalink Posted: 23 Oct 2016 05:08 AM PDT I have the has_permalink gem set up and working fine. However, google is crawling my website with looking for events with ids, not the permalink. This is what i currently have: However when someone types in an ID e.g. The solution I came up with is this: But I would rather have the website still show the friendly URL link in the URL rather than the ID of the event. Any ideas how I would approach this? Thanks Sam |
Table showing the result of queries using rails Posted: 23 Oct 2016 07:24 AM PDT Here is my problem. I have a model called Visit (which belongs to Visitor model): I have a table like this (name, last name and serial number are visitor's fields): Name, Last name, Serial number, From, To Now I have four buttons: Current visits, Confirmed and about to start visits, Terminated visits, Visits to be approved I need that, clicking on these buttons, the table shows the result of queries. For example, clicking on Terminated visits the table will show all the visits having end < Date.today, clicking on Current Visits the table will show all the visits having start <= Date.today && end >= Date.today and so on and so forth. In addition, Current visits button should be considered selected as default. I don't have any idea about this kind of implementations being a newbie at Ruby on Rails and I really hope you can help me. Thank you in advance! EDIT: My main problem is the following: I need to fill the table with visit.visitor.name, visit.visitor.lastname, visit.visitor.serialnumber, visit.start, visit.end (by default I need to show the results of button current). When I click on one button, the table should show just the entries which respect the condition associated the clicked button. Ex: if I click on terminated, the table should show the entries having end < Date.today. |
Rails 5 missing template that was added to lookup Posted: 23 Oct 2016 06:17 AM PDT I have added into
and created a view 'app/views/cabinet/index.html.slim'. But when I go to route
What I'm doing wrong? |
Heroku run rake db:migrate error when trying to deploy Posted: 23 Oct 2016 06:36 AM PDT I'm trying to deploy my Rails app on Heroku. It was working up until I tried to run I'm getting this error: I've been trying to fix this for a couple hours. Any help would be greatly appreciated! |
Added Column Not accessible in next migration file Posted: 23 Oct 2016 05:11 AM PDT I have added a column to my table via a migration, but I am not able to access the added column in the subsequent migration file. When I execute below is the code where i am adding column ** ** Now, when i try to access the column in next migration file it fails. The subsequent migration file has the code below service_member = Member.create(:is_dispatch=>true) And Here is the error that it produces |
Dynamically mount Carrierwave uploader on serialized field Posted: 23 Oct 2016 02:24 AM PDT I'm creating this app where users are able to dynamically add custom fields ( The custom fields can have type text or image, and have custom naming. A user can for instance create at field named Profile picture of type image to their template. I can't however figure out how to dynamically mount a CarrierWave uploader to fields of type image, when everything is saved to an Any help is much appreciated! |
Not able to connect mongodb with Rails container using Docker compose Posted: 23 Oct 2016 01:38 AM PDT Getting this error when inserting values in Model through rails console .
Both containers are running fine, but Rails not able to connect mongodb . My docker-compose.yml file contents are: My Dockerfile : |
How to properly load lib modules and classes in Rails 5 app Posted: 23 Oct 2016 01:38 AM PDT How do I include a '
And I want to include that class in my User model ( I've tried adding this to my
but it doesn't work. What am I missing? How do I include |
Model name and path after routing in Rails Posted: 23 Oct 2016 01:26 AM PDT Here's my routing I have an error in the page new (form rendering) That was before routing add and everything works great Then I change it to And got at error: undefined method `model_name' How should I fix it? |
Ruby on Rails, taking data from Graphql and posting on it to Facebook-messenger Posted: 23 Oct 2016 12:22 AM PDT First of all this is an messenger bot and with this messenger bot i am taking users input and i am searching the input in our database then i post something related with the input. So, in the code i can't search beacuse, in my opinion I take users input with |
Different versions of the index page for ActiveAdmin Posted: 23 Oct 2016 12:20 AM PDT I'd like to have two different index pages for my model, i.e. |
How to define let! with mutliple objects in Rspec test? Posted: 23 Oct 2016 02:49 AM PDT I'm practicing my Rails tests and right now I don't know how to solve this issue: How to define multiple objects using let! method. It returns normal array, not ActiveRecord relation. I guess that they should be both ActiveRelation relation type to be able to compare. After running tests: |
How to get access token and refresh token from google api? Posted: 22 Oct 2016 10:07 PM PDT Using I added google_drive.yml file for credential. when I download credential file from google api I get following things
Now I also need
So How can I get this two token from google ? Can you please help me to how can I find this or How can i generate this? |
Displaying and Creating multiple entities rails Posted: 22 Oct 2016 10:03 PM PDT Hey guys im learning rails and as an assignment we have to do a site where people can bet on sport matches. Each match has two teams and three dividends (local win, visitor win or draw) that determine the users profit for each bet. These bets alone have no value because they go on to a ticket associated with the user and the amount and where the total profit is calculated. The ticket consists of up to three bets. Right now i have all the logic and views of the Matches but im trying to do the ticket one and im having some trouble. I already display a list of matches to the user like this: Match list From there i would like it if the user could click on the dividend number to select the match and the result desired and that would make that selection one of the three possible bets. For instance, if the user clicks on the draw dividend that would load a bet with that dividend for those two teams and a draw result. Once the user clicks on a dividend i want to dynamically load a table showing the current bet selected and a "submit" button that from those bets generates the ticket and persists them all to the database, how can i do it in a simple way? Thank You! |
Update rails with amazon cloudfront and test rails Posted: 22 Oct 2016 09:15 PM PDT I am new to rails and also to amazon cloudfront. I went through the link below to create amazon distribution I created an amazon distribution group using DEV server origin domain name as Distribution domain name is I am working locally on application This is the css rails application serving How can i test the css above before updating rails code? How can i update the rails production.rb for cloudfront distribution? We have dev/stage/prod servers so in order to test on dev server do i need to update development.rb in cofig/environments? Also can i test application locally for this or do i need dev server? Thanks |
How can I prepare my rails app for production? Posted: 22 Oct 2016 08:02 PM PDT I've built a marketplace application using Rails, Devise, Heroku, and Stripe Connect. I want to launch the application in about 30 days. I have never actually launched an app that will be available to customers and has money involved. I'm kind of hazy in regards to what I need to do from here out to make sure the application will work as intended for the customers. I've read Basecamps Rework book which motivated me to launch sooner than trying to perfect it and have made the app as agile as possible as a result. I can't say I'm much of a programmer as I learned rails and programming in my spare time. If anyone has any experience in managing a rails app for live production please give me tips on things you wish you knew before. Thank you! |
Posted: 22 Oct 2016 07:56 PM PDT I'm new to both MySQL and Rails. I'm going through a course on Lynda (Ruby on Rails 5) and I ran into a hiccup. After creating a database it's having me start up MySQL and Puma. I attempt to access localhost:3000 however I get the following error: It seems like everything is working properly, both MySQL and Puma start: Below is my database.yml file: I looked through Stack Overflow and see others have had similar issues, however it seemed to be a password issue, which I'm not having. Any help will be greatly appreciated. |
Form submission within render partial is showing errors for all forms on all objects Posted: 22 Oct 2016 07:20 PM PDT To clarify my title, my portfolio/show file looks like The file that is rendering in line <%= render @positions %> is my _position.html.erb file. When I submit a number to buy or sell shares, the post request goes through and a movement is created. The issue I'm having is that I want to show an error message when a person submits nothing ensuring that a movement always has an integer value. My first error when dealing with this problem was when I submitted a nil value, I would get an error saying @partials within the render line was not defined. So I defined the variable in movements_controller. When I submit a nil value now, 2 things happen: 1) the post goes through and a movement is made with a quantity of nil, and 2) All of the buy/sell forms on all the position objects show me the error saying quantity should be present. My movement class is defined My movement create method is defined as and the sell action is defined as |
Rails 5 display number of results when grouped Posted: 22 Oct 2016 08:18 PM PDT I'm building an app using will paginate and ransack. My controller: Then in my view I have this to show the number of entries found: But as I am applying group, it shows which shows thew number of entries for each product (as it's grouped by product). Obviously I need to show just the total entries, not for each product. How to fix this? |
Skipping Active Record breaks Rails Generator Posted: 23 Oct 2016 02:33 AM PDT I created a new Rails project with the After that, I created a new project (exactly the same, just without I'm using Ruby 2.3.1 and Rails 5.0.0.1 on Ubuntu Linux 16.04 LTS. |
flash[:notice] is throwing error when I use Ruby 1.9 with Rails 2.3.4 Posted: 22 Oct 2016 03:29 PM PDT The Post pages I just generated using the scaffolding but they are not working When I try to access the New post page it give me the error. Here is My layout code Error that I get when i try to access the page Here is the gem list that I am using with ruby 1.9 Note: I also downgraded my RubyGems to 1.8.25 as newer was not working with db:create rake command |
ElasticSearch: Altering indexed version of text Posted: 22 Oct 2016 03:00 PM PDT Before the text in a field is indexed, I want to run code on it to transform it, basically what's going on here https://www.elastic.co/guide/en/elasticsearch/reference/master/gsub-processor.html (but that feature isn't out yet). For example, I want to be able to transform all Any advice? Doing this in elasticsearch-rails. |
Posted: 22 Oct 2016 03:18 PM PDT I m trying to parse youtube url. At this time my code is ok with standard youtube url. But don't work with list or youtu.be like this My code is How I can fix this ? By the way I want to show an alert if url isn't from youtube. |
Posted: 22 Oct 2016 03:19 PM PDT I am a beginner and am trying to test whether the following code maps to the "home page": what should I replace the first and second "FILL_IN" with in the block below? Would appreciate your help! |
In Ruby, What exactly is the difference between RVM, Bundler and Rake? Posted: 22 Oct 2016 03:20 PM PDT I know RVM stands for Ruby Version Manager, and that it helps you manage the versions of ruby across projects. But when running commands, programs or tasks some times you use rake and sometimes you use bundle. |
Big discrepancy in ruby Time arithmetic used with active support Time extensions Posted: 22 Oct 2016 02:42 PM PDT This code should not have, to my understanding, produce different results between third and second examples. Oddly enough when I convert everything to Fixnum it's back to working as expected. What is going on? |
Rails 5 has many through association with fields_for - How write the form and controller? Posted: 22 Oct 2016 11:42 PM PDT I have model User user.rb team.rb team_user.rb I want to save the team members on the team page in a nested form. Should look like my html.erb and what should be in the controller? |
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