Update many to to many relationship having ids | Fixed issues |
- Update many to to many relationship having ids
- Duplicating record isn't duplicating image
- How to create 1- and 2-dimensional hash
- Path to a root file in controller
- Activeadmin polymorphic association, paperclip attachments
- Which page a record is on?
- Rails: Accept optional nested Image; allow to add later if nil
- How to add range filters in Rails?
- .html.erb set div doesn't work correctly
- How to use Google::Auth::Stores::FileTokenStore.new for Google Calendar API
- render an action from clicking a button without reloading page: Ajax
- i received this error 'Unpermitted parameter: image' in nested parameter
- How to upload videos (resumably) to Vimeo from a Rails 5 app?
- Grab current users "admin" attribute from database
- Rails 5: How to send and process large files (200Mb) via Rails API?
- Why does have_selector "#MyId" fail when match /id=\"MyId\"/ passes?
- jQuery.event.props is undefined
- Rails 4 - Statesman - no method error
- Unable to permit additional parameters in device#accept invitation
- Updating Heroku database without deleting anything
- Getting real ip from Google Cloud Load Balancer and cloudflare
- ArgumentError in ContactsController#new
- Push object to s3 via aws ruby api v2
- check current time is greater than defined time rails 4
- 1 error prohibited this entity from being saved: Addresses entity must exist
- drop_table migration not working
- Turbolinks not ignoring page in Rails app
- How to develop an API to make instant transfer from perfect money to payza/webmoney [on hold]
- How whatsapp refreshes as soon as qrcode is scanned
- Error after removing column in database
Update many to to many relationship having ids Posted: 31 Jul 2016 07:49 AM PDT I have 3 model with many to many relationship: Say I have a single person and I want to update the list of movies they star in. For movies I have ids. How can I do that? I want to avoid quiering the movie objects before updating. |
Duplicating record isn't duplicating image Posted: 31 Jul 2016 07:52 AM PDT I'm trying to duplicate my record and using the amoeba gem. Everything copies fine except for the image (which is uploader via carrierwave) For the image I tried doing a customized setting in amoeba like this: but that just returned the path of the image still which when loading is looking in the individual record id. |
How to create 1- and 2-dimensional hash Posted: 31 Jul 2016 07:51 AM PDT I am loading data from database and saving it to a constant like this: On the line I want to use How can I make |
Path to a root file in controller Posted: 31 Jul 2016 06:50 AM PDT
Controller: Views:
|
Activeadmin polymorphic association, paperclip attachments Posted: 31 Jul 2016 05:59 AM PDT I am using activeadmin for And and my and in my Can anybody please explain how to fix this issue? |
Posted: 31 Jul 2016 05:38 AM PDT I want to have my pager start on the page for a given record and be able to page through the records before and after in the collection. i get the code from here https://github.com/amatsuda/kaminari/issues/205 and its working when i put <%= @page_num %> on show.html.erb it give me the page number that the record is on but i dont know how i can make it work in here is my model song.rb songs_controller.rb show.html.erb _songs.html.erb show.js.erb |
Rails: Accept optional nested Image; allow to add later if nil Posted: 31 Jul 2016 07:09 AM PDT I have a simple Article model associated with an Image model. The relationship is currently one-to-one (might change later but is fine for now). Everything works fine when I create an Article from scratch and add an Image to it. Here's the catch: I would like the Image to be optional at creation, but also I would retain the option to add an Image at a later stage. However, I am not sure how to handle that through the edit action. I have tried this: ... which results in: ActiveRecord::RecordNotSaved in Admin::ArticlesController#edit Failed to save the new associated image. The form currently looks like this: How can I accomplish optional nested images that can be added through the edit form later on? Thanks! |
How to add range filters in Rails? Posted: 31 Jul 2016 06:06 AM PDT I have a model Entry with attributes date and time. I want to add filters on index.html.slim with 4 input form: 1) start date 2) start time 3) end date 4) end time And I want this form to find all records in this range. |
.html.erb set div doesn't work correctly Posted: 31 Jul 2016 03:45 AM PDT I just created a I want each story div has a red background for example: _stories.html.erb But the result is the red div all in top of the story model properties. Thank you! |
How to use Google::Auth::Stores::FileTokenStore.new for Google Calendar API Posted: 31 Jul 2016 03:44 AM PDT I'm trying to access the Google Calendar API from my Rails app. The official guide is rather scarce, but I think I get most parts except for |
render an action from clicking a button without reloading page: Ajax Posted: 31 Jul 2016 03:55 AM PDT Im using ajax to make a controller action when clicked without reloading page. I cant seem to get the js view to be rendered. transactions_controller: My link on index.html.erb: routes.rb: escrow.js: Im not sure what I am doing wrong! thank you! :) |
i received this error 'Unpermitted parameter: image' in nested parameter Posted: 31 Jul 2016 02:54 AM PDT this is my profiles_controller.rb profile.rb has a nested attributes from image.rb This is profile.rb this is image.rb this is _form.html.erb from profile.rb model |
How to upload videos (resumably) to Vimeo from a Rails 5 app? Posted: 31 Jul 2016 05:31 AM PDT I am trying to upload videos to my Vimeo account from my RoR 5 application using the Vimeo API and the option "Resumable HTTP PUT uploads": https://developer.vimeo.com/api/upload/videos#resumable-http-put-uploads For this I'm using Paperclip to upload the video to my application and then I want to do a multipart PUT request to send the file with the Thanks in advance. |
Grab current users "admin" attribute from database Posted: 31 Jul 2016 02:18 AM PDT I have a Users model that has a field which is admin. This field is a boolean. I only want a user who is an admin (admin field = true) to be able to create a "Season." How on earth would I do this on rails? I don't even know where to start. I assume that in my application controller I could define "current_user_admin" and in my view use "current_user_admin?" to show the "create season" link. But what do I do in the model? I do have current_user defined as such in my application_controller: Am I going down the right path? Any guidance is appreciated! |
Rails 5: How to send and process large files (200Mb) via Rails API? Posted: 31 Jul 2016 01:44 AM PDT I'm looking for the general concept, but every tip can be useful. The client (mobile) has to send a large file to Rails API. It's a some text file with raw data. How can the Rails API get the large file from client? Should it be done by HTTP request, websockets? Should the files be sent in chunks? |
Why does have_selector "#MyId" fail when match /id=\"MyId\"/ passes? Posted: 31 Jul 2016 02:23 AM PDT I have a rails helper that generates a form And tests for this helper I am still learning rspec, so this may be an obvious question. Why are these tests failing when using |
jQuery.event.props is undefined Posted: 31 Jul 2016 01:08 AM PDT I'm using jquery.event.move to create move events on touch devices. The script is throwing an error on line 580. When it gets to line 580 it throws |
Rails 4 - Statesman - no method error Posted: 31 Jul 2016 07:28 AM PDT I have a model called organisation request. I have put statesman files on this model. I have a couple of other models which I have also added statesman to and those work fine. When I try to use this state machine, I get errors which say: Can anyone see why? |
Unable to permit additional parameters in device#accept invitation Posted: 31 Jul 2016 12:58 AM PDT I'm unable to permit additional parameters in "invite#accept". I've setup everything and here's a controller. But in the method "accept_resource" there're still only 3 old parameters accepted, other didn't come through, although they present on a form. How to fix that? devise devise 4.2, devise_invitable 1.6 |
Updating Heroku database without deleting anything Posted: 31 Jul 2016 12:46 AM PDT I have my project in production right now using Heroku, but I want to add more tables and such to my rails database and than push it to Heroku. And I also plan on upgrading to Rails 5. Are there any general rules that I should or shouldn't be doing so that my existing databases of Users does not accidentally get deleted? Also, i noticed that Heroku has a 'backup' feature. Does this backup feature save a copy of all my Users information (email, name, pw, ect) which I can restore back at any certain time in case the unthinkable happens? |
Getting real ip from Google Cloud Load Balancer and cloudflare Posted: 30 Jul 2016 11:43 PM PDT I want to get my real ip I'm using cloudflare and Google Cloud Network Load Balancer. I have put this source to nginx.conf To check my ip, I made simple rails source. . But ip was not my ip, it's Google Cloud LoadBalancer's. How do I fix this problem? I tried a lot of time over 6 hours. Thanks. |
ArgumentError in ContactsController#new Posted: 31 Jul 2016 04:09 AM PDT I am getting an error when I visit the page: The error, details and the source code is provided below. wrong number of arguments (1 for 2) Extracted source (around line #4): model.rb Code for controller |
Push object to s3 via aws ruby api v2 Posted: 30 Jul 2016 11:35 PM PDT I'm trying to upload a file to amazon s3 but I'm getting the following error: Here is how I'm doing it: I'm sure I'm using the right region, credentials etc.. What can I do ? |
check current time is greater than defined time rails 4 Posted: 30 Jul 2016 11:51 PM PDT I would like to check it my current time is greater than a defined time. My start time could be anytime from day: Like, I need to see if this time is greater than Means if any point my but its not working as expected. any possible way to get this? Plus please could anyone tell best practices as well to calculate the difference? |
1 error prohibited this entity from being saved: Addresses entity must exist Posted: 30 Jul 2016 11:25 PM PDT can't able to save my entity.I have used nested_form gem and have permitted the addresses_attributes in entity_params but this error appears .please help me guys 1 error prohibited this entity from being saved: |
drop_table migration not working Posted: 31 Jul 2016 03:36 AM PDT Im having problems deleting a table that i created in migration. executing Typo Edited: subject -> subjects this happens only when i use |
Turbolinks not ignoring page in Rails app Posted: 31 Jul 2016 12:09 AM PDT The front page view ('Welcome/index.html.erb') : https://github.com/bfbachmann/Blog/blob/master/app/views/welcome/index.html.erb Rails Version: 4.2.6 The overarching problem: I am trying to get my THREE.js model to show up properly inside my rails app. Everything works fine when I load the page by typing its URL into the search bar in my browser or if I hit reload or 'command' + R (on Windows its 'ctrl' + 'R') on my keyboard. I have a feeling this is because Turbolinks is not fired when these actions are performed. This leaves my model in the state it should be in as shown below. HOWEVER... when I click one of the links in the navbar (blog, projects, about etc.) and then return to the home page by clicking the house icon either the rotation speed of the model doubles, or the model is duplicated. If the model is duplicated one copy stands still while the other rotates at its regular speed as shown below. What I've Tried I have a strong feeling Turbolinks is to blame for this. So I tried to get Turbolinks to ignore that page by adding 'data-no-turbolink' to the body of that page... it didn't work. In fact I think Turbolinks was not even ignoring the page because it still loaded much faster when I clicked the home page link than when I re-entered the page's URL. I tried adding a callback that would stop all the javascript responsible for the front page from running when the user navigates away from the page. This can be found in the view I linked at the top. I know this callback gets fired because I tested it. That also doesn't solve the problem. Finally, I should also mention that I am using the JQuery-Turbolinks gem to resolve conflicts between the two. Any help would be much appreciated. I have been trying to solve this problem for weeks. Edit: I forgot to mention that I have read that Turbolinks has problems with inline javascript... this could be causing that problem. Edit: It appears my javascript is being run every time I load ANY page on my site even though it is inline javascript. I can't understand why. |
How to develop an API to make instant transfer from perfect money to payza/webmoney [on hold] Posted: 30 Jul 2016 11:17 PM PDT I'm looking for an API or library in Ruby or python or wordpress that can help me to develop an API to make instant transfer money between e-banks something like changer. Also if there is a guide to help me to do it and start a business in that field. Thanks in advance. |
How whatsapp refreshes as soon as qrcode is scanned Posted: 30 Jul 2016 10:39 PM PDT How whatsapp actually refreshes the page as soon as the qrcode is scanned? Is it some sort of websockets or javascript? How to implement it on Ruby on Rails Kindly help ASAP |
Error after removing column in database Posted: 31 Jul 2016 07:11 AM PDT I removed a column named assignment from my assignments database and encountered the following error: assignments_controller.rb: I'm well aware that it could be because of the I've tried changing that line to: but to no avail. Please help me on this matter. Thanks in advance! |
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