Rails 4 Associations: Help setting up database | Fixed issues |
- Rails 4 Associations: Help setting up database
- Rails routing sometimes replaces the id in url with id-name. How do I avoid problems?
- When deploying my Rails 4 application with Capistrano, how to avoid a user timeout error?
- Testing whether geocoding happens before_validation
- Cloud9 Warning do I just ignore?
- Rails ajax dropdown menu set selected
- use params[:file] as parameter for ActiveJob
- Ruby on rails - bootstrap material design - Add checkboxes to simple form
- ActiveRecord single table inheritance - how to get root model?
- Possible Poltergeist memory leak - how to use session.driver.quit?
- Simple form calling undefined url helper when generating a form for a nested resource within a namespace
- Wait for Ajax call to finish for Capybara
- Arel and ActiveRecord's count throws error
- Rails 4 - Custom Validation Error
- I have to click confirm around 5 times when i delete something in my Rails app [on hold]
- solr sunspot unicode? characters
- Cast old string values to datetime with migration in Rails PostgreSQL
- Ajax - Why isn't my remote rails form exucuting create.js.erb?
- Matching Signed Headers Encrypted in Ruby on Rails and JavaScript
- Pass data to modal
- ruby on rails braintree fail on duplicate payment method
- Ruby on Rails server requirements
- ActionView::Template::Error (singleton can't be dumped)
- Ruby on Rails 4/ Turbolinks - how to disable turbolinks on a Rails UJS (ajax xhr) call
- NGINX Config: How to match any filetype or subfolder of given path?
- Deploy ActionCable on Heroku (Rails 5 beta4)
- Rails: Validates greater_than_or_equal_to 0 does not work
- Devise email templates [on hold]
- Handling Confirmations of link by Custom Jquery Dialog in Rails
- Dotenv not availabe in routes.rb?
Rails 4 Associations: Help setting up database Posted: 02 May 2016 06:55 AM PDT I need some assistance with my Rails 4 associations. I have the following 4 models: Question: If I am setup this way, how would I input |
Rails routing sometimes replaces the id in url with id-name. How do I avoid problems? Posted: 02 May 2016 06:56 AM PDT Generally the url from my report page looks like this: However, sometimes it looks like this: Why does this happen? It was not really a problem until we changed the controller action from a GET to a POST and renamed it. We had to do this so we could pack more parameters in to the ajax request. Users still have this section of the site bookmarked and it throws errors all day long. I have tried to redirect the route: Is there a way to catch the name? Or do I have to prevent the name from being added to the url in the first place? |
When deploying my Rails 4 application with Capistrano, how to avoid a user timeout error? Posted: 02 May 2016 06:37 AM PDT I deploy my project to my production server using the How can I handle this so at most is just a little longer of a wait for the user? Currently, in my database.yml config I have the timeout set to: |
Testing whether geocoding happens before_validation Posted: 02 May 2016 06:25 AM PDT we're using geocoder gem within a Rails 4.2 Application. Geocoding happens for a places model with address attributes (:street, :postal_code, etc.) using the geocoder gem with nominatim as the API of our choice. Now, I wanted to test whether geocoding is happening accordingly Within the places model the geocoding is set to Thanks in advance! |
Cloud9 Warning do I just ignore? Posted: 02 May 2016 06:29 AM PDT During testing in chapter 3 I get the following warning, is this ok to ignore?
Thanks Gaz Smith |
Rails ajax dropdown menu set selected Posted: 02 May 2016 06:30 AM PDT I have ajax script which selects necessary data and returns array server response script It works fine, but I cant set selected Also i have tried but cant pass value to |
use params[:file] as parameter for ActiveJob Posted: 02 May 2016 06:10 AM PDT I have a form with a file upload field, which sends a This however returns an error: Is it possible to send a file parameter to a job? |
Ruby on rails - bootstrap material design - Add checkboxes to simple form Posted: 02 May 2016 06:13 AM PDT I installed the Bootstrap Material Design in my Ruby on Rails application and every animation is functioning properly, but i can´t see the checkboxes. My code for the checkboxes is: Can anyone Help me please? Thank you all! |
ActiveRecord single table inheritance - how to get root model? Posted: 02 May 2016 06:20 AM PDT I have a model using single table inheritance and a concern that should work on any model. Consider this example: Now if I have an I don't want to hardcode this, so given a |
Possible Poltergeist memory leak - how to use session.driver.quit? Posted: 02 May 2016 05:35 AM PDT I think I'm running into a memory leak when running Rspec/ Capybara tests. At least, this reasonably high-specced Macbook Pro — and Chrome in particular — slows to an almost unusable crawl when tests are run. Poltergeist mentions this as a possible issue (I am running JS tests). The suggested fix is to include When I include |
Posted: 02 May 2016 05:40 AM PDT Greetings everyone, I have the following routes: And the following controllers:
The generated route url helper for an However when using simple_form: I know it's possible to manually set the URL when invoking Why is simple form calling undefined URL helpers that way? And what can I do to make it call the right ones properly? |
Wait for Ajax call to finish for Capybara Posted: 02 May 2016 05:11 AM PDT I am fetching data from a server(via ajax) using 3 select dropdowns. I want to write an integration test where I need to wait for the ajax request to finish then select a value from the next dropdown. So far I am waiting for some seconds before doing the next select but that's not reliable and not a good solution. |
Arel and ActiveRecord's count throws error Posted: 02 May 2016 04:58 AM PDT I'm trying implement a library function which should return Simplified example: It looks like Even more surprising, other methods from ActiveRecord::Calculations work correctly, even comparable Any idea what am I doing wrong ? How adjust Arel object to work also with I have to return |
Rails 4 - Custom Validation Error Posted: 02 May 2016 05:28 AM PDT This is my model - When I try to run the validation, it only seems checks the first one "0" even if i change the selection to "1". Any help would be appreciated! Thanks |
I have to click confirm around 5 times when i delete something in my Rails app [on hold] Posted: 02 May 2016 05:20 AM PDT I have to click 'confirm - yes' around 3-6 times each time i want to delete a note on my notebook application, any ideas why? I have includes a before_action in the controller that includes the destroy function of CRUD: Here is the destroy code itself: |
solr sunspot unicode? characters Posted: 02 May 2016 04:43 AM PDT How do I use this file provided in sunspot (mapping-ISOLatin1Accent.txt)(or is this the one I need as well)? I need to be able to search for and I have tried moving the I have also searched and found various solutions mostly pointing to this or this articles but those don't seem to work either. |
Cast old string values to datetime with migration in Rails PostgreSQL Posted: 02 May 2016 06:39 AM PDT I had a couple of date fields in a database table, however they are firstly initiated as string, not datetime. Therefore, I wanted to change those value types to datetype with a migration, however it can not cast old string values to datetimes that exists in database currently, saying that PG::DatatypeMismatch: ERROR: column "flight_date_departure" cannot be cast automatically to type timestamp without time zone. HINT: You might need to specify "USING flight_date_departure::timestamp without time zone". We've done it without problem in a SQLite database, however there is this problem for PostgreSQL. How can I modify my migration so that I do not lose old values and properly convert them to datetime? |
Ajax - Why isn't my remote rails form exucuting create.js.erb? Posted: 02 May 2016 04:49 AM PDT I'm getting this error each time i try to post a comment although when I refresh the paage comments are displayed HTTP500: SERVER ERROR - The server encountered an unexpected condition that prevented it from fulfilling the request. (XHR): POST - http://website.com/posts/37/comments in chrome I got Failed to load resource: the server responded with a status of 500 (Internal Server Error) in my comments controller and I set the form to remote: true so its supposed to execute the code in create.js.erb which is commenting is working but the format.js is not heres the trace |
Matching Signed Headers Encrypted in Ruby on Rails and JavaScript Posted: 02 May 2016 03:59 AM PDT I am using ApiAuth gem (as found here) to sign my request. I am also writing my own JavaScript code using CryptoJS (as found here) to provide authentication by checking the encrypted header generated by ApiAuth against the one generated by my code. Given below is a code snippet from ApiAuth Gem: Here is the code I have written as an equivalent in JavaScript: These two don't generate the same encrypted header. I tried using jsSHA to do the same thing and while the encrypted header generated by jsSHA and CryptoJS is the same, they don't match the one generated by ApiAuth. Kindly help me figure out how to make this work. |
Posted: 02 May 2016 04:02 AM PDT Sorry for that question, googled a lot.. but I cant find a solution.. I am using materialize css (not twitter) and want to pass an ID in a modal HTML COFFEE In Modal Thanks for helping.. |
ruby on rails braintree fail on duplicate payment method Posted: 02 May 2016 03:51 AM PDT i am trying to implement braintree payments into a ruby app, and everything seems to be working fine, but when i pass fail_on_duplicate_payment_method_card as an option i am getting invalid keys: options[fail_on_duplicate_payment_method_card] |
Ruby on Rails server requirements Posted: 02 May 2016 06:31 AM PDT I use rails for small applications, but I'm not at all an expert. I'm hosting them on a Digital Ocean server with 512MB ram, which seems to be insufficient. I was wondering what are Ruby on Rails server requirements (in terms of RAM) for a single app. Besides I can I measure if my server is able to support the number of application on my server? Many thanks |
ActionView::Template::Error (singleton can't be dumped) Posted: 02 May 2016 05:10 AM PDT I am using gem 'jbuilder_cache_multi' for cache my json responses. I am encountering a strange error when i hit my api from my ios native app. Below is the error i got: Request is: Can anyone help in this regard. Thanks |
Ruby on Rails 4/ Turbolinks - how to disable turbolinks on a Rails UJS (ajax xhr) call Posted: 02 May 2016 04:41 AM PDT On a Deal page, I have a Rails UJS call. It loads a modal. The problem is the following:
I am 100% sure it's due to turbolinks as I removed it and then it works. I want to keep generally turbolinks but to disable it only for this AJAX call. I read all i can think of on SO and the web but nothing works. CODE (note: on the hompeage: just the list of the deals and I can click on a deal- it's a standard link) Deal page html When the user clicks the Rails UJS link, it points to views/modal.js.erb (I am using hubspot Messenger also as below) In terms of html, this modal is: I tried adding directly of via a jquery injection data-no-turbolink to those different places and it never worked on the main link_to with the Rails UJS or even on the parent div of the modal: But nothing worked. I feel what the techniques I tried using are only working when you want to disable turbolinks on a on page:load, or page:change but not when you need to disable it ON the elements that are loaded on an event I don't actually know the name but which is kind of "page:ajaxcall", that is to say on the content loaded by an ajax call by Rails UJS. |
NGINX Config: How to match any filetype or subfolder of given path? Posted: 02 May 2016 05:30 AM PDT I need to bypass rails via NGINX for any requests that fall beneath a certain path for various assets such as: I am currently trying to edit the nginx config such that any web request maps to the appropriate file: Which isn't working - I assumed that any request of |
Deploy ActionCable on Heroku (Rails 5 beta4) Posted: 02 May 2016 03:40 AM PDT I have a working rails 5 app with ActionCable on my localhost, and I'm trying to deploy it to heroku. When accessing the page where the chat room is, I can see in chrome's console: I did setup Redis and the Redis addon on heroku. Here is the production part of my cable.yml file: Here is my room.coffee file: Setting up ActionCable on heroku seems tricky, and every post I've found on the subject is either using Phusion Passenger (I'm using Puma), or with a pretty old version of ActionCable (I'm using the latest beta of Rails 5). How should I set this up ? Thanks for your time and help |
Rails: Validates greater_than_or_equal_to 0 does not work Posted: 02 May 2016 03:47 AM PDT I shouldn't be able to set Given: This should not happen: |
Devise email templates [on hold] Posted: 02 May 2016 05:15 AM PDT I'm working with Devise in Ruby on Rails and I want to change defaul Devise email templates. I can't find .css files for email templates. Where should I put .css files for email templates? |
Handling Confirmations of link by Custom Jquery Dialog in Rails Posted: 02 May 2016 05:49 AM PDT I needed a custom pop-up dialog in order to replace the default browser option for data-confirmation. There were a lot of example online for data-confirmation for method: delete, however I needed to make minor customization to make it work for normal links as well. For example there are the 2 types of links I would render a dialog for: With the information I have researched online, I have come up with the following jquery code for app-wide confirmation for these types of links: My problem is that the authors of the articles don't explain well about what is happening. So therefore my questions are: What does the following code mean: In the line |
Dotenv not availabe in routes.rb? Posted: 02 May 2016 03:22 AM PDT eversince I started using Dotenv inside my routes.rb I get weird errors. I'm using
Terminal: I did not do anything between these two Anyone knows what's happening? |
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 |
Many thanks for your kind invitation. I’ll join you.
ReplyDeleteWould you like to play cards?
Come to the party with me, please.
See you soon...
เล่นบาคาร่า
คาสิโน
คาสิโนออนไลน์
คาสิโน