undefined method `id' for nil:NilClass on my style tags | Fixed issues |
- undefined method `id' for nil:NilClass on my style tags
- Creating a dynamic xlsx with the write_xlsx gem
- How to remove duplicates from where in rails
- Rails - creating place with weekdays in one form
- How remote: true work here without the js in controller and view file?
- traditional rails commands don't work with ruby 2.3
- No route matches {:action=>"edit", :controller=>"admin/progresses"} missing required keys: [:id]
- Why can't the post method in my Rspec test find the create action/route for my PostsController?
- rails : Auto refresh a div
- Rails session variable doesn't get set until page reload
- Updating "Receipt" comments on a Shopify Order using ShopifyAPI::Fulfillment
- Regex for gsub in rails
- ruby on rails - if I have 2 models can I sort them both at once?
- Rails 4: How to prevent jumping to index
- Rails: Choosing an object on button click and showing info on modal
- Ruby on Rails execute recurring task
- How to pass arguments in I18n.translate
- Creating has_one association within the same model
- Could performance issues imerge when using ActionCable in Production?
- How set cookie sent from server to a client on a different port
- Tool for slicing app into microservices
- Javascript / jQuery - Price calculation
- Access library from view in Rails?
- With Rails4.2 I'm not able to handle Exceptions like RoutingError
- rails c command not working on OSX
- Handling Parameters in Rails
- Rails wicked wizard with javascript
- undefined local variable or method `acts_as_nested_set'
- Scalability of web application with nginx and two physical linux servers
- Wrong SQL for destroy model in Rails 4.2
undefined method `id' for nil:NilClass on my style tags Posted: 07 Sep 2016 07:46 AM PDT am having when i remove the style tag and javascript tag the page loads fine. am using rails 4 |
Creating a dynamic xlsx with the write_xlsx gem Posted: 07 Sep 2016 07:42 AM PDT I want to export a part of my db for the user as a .xlsx I managed to create a static file and let the user download it, but that's not really the point. The user should select the filter he wants and as a result the file should be created and downloaded directly through the browser. my code looks something like this: controller the result would be a file and the content is just the name of the object I'm not sure if this is something write_xlsx specific or if I'm missing something obvious here. |
How to remove duplicates from where in rails Posted: 07 Sep 2016 07:34 AM PDT so i have this code here However whats happening at the moment is that the Any ideas would be great! |
Rails - creating place with weekdays in one form Posted: 07 Sep 2016 07:46 AM PDT I created a model for a Place and a model for OpenDay: I want to be able to create a record of this place (what I have now is simple textfields) with day of the weeks (and hours) that the place is opened at. My current form: My new controller I decided to go with a table (screen below) but I have absolutely no idea how to create a form for another model inside my existing form for @place. And what's more to be able to save multiple records using this form. Searched through SO but came with noting. |
How remote: true work here without the js in controller and view file? Posted: 07 Sep 2016 07:20 AM PDT I am wonder how this is working alone?,,, I just add the remote: true here and ajax work fine.. I didnt create any js.erb in view file and did not add the format.js in the controller file... and it is working..how is that? Anyone can explain this? here is my code where I added the remote: true: |
traditional rails commands don't work with ruby 2.3 Posted: 07 Sep 2016 07:23 AM PDT I updated my ruby version to 2.3, and now when I try simple commands like Can you please help me with that, I can't find any answer online :) |
No route matches {:action=>"edit", :controller=>"admin/progresses"} missing required keys: [:id] Posted: 07 Sep 2016 07:31 AM PDT While trying to create my edit link for my admin dashboard.I have this error... here is my This is my views/admin/progresses/index.html.slim This is my admin/progresses_controller.rb: Many thanks ! :) EditThanks everyone for all the answers!
|
Why can't the post method in my Rspec test find the create action/route for my PostsController? Posted: 07 Sep 2016 07:24 AM PDT Hi I have an Rspec test: That is throwing the following error: Which means it can't find the route right? instead of passing :create as the first argument to post I have tried, passing it the route helper user_posts_path(user) <--- (this is the route for my posts create action), but I get pretty much the same error. Here is that attempt: which throws this error: I've also attempted to pass in the id manually: as the second argument to post. Here is the post_factory.rb since I am calling attributes_for(:post): My relevant rake routes: My PostsController create action is alive and well too. So I know my route is there and I have tried passing the post method an explicit route instead of :create, but I still get the same error. I believe the problem is occurring because my routes are nested, but I need them to be nested, and would like to test them in that form so I can't change the nesting. I'm not sure what else to do, so I've come here for help. Thanks. |
Posted: 07 Sep 2016 07:19 AM PDT Sorry for my english i'm french. I'm a newbie in javascript, an i have a question : I have a controller and a view with a div : get_requests return all the requests in database (with a select) and i print in it in a div in my view In this div i print all requests with other things. I want to automatically refresh this div with a js/jquery function, (for the moment i use a button for refresh) but i need to re-execute the code in my controller ? I'm newbie in js. Thank you and sorry for my english ;) |
Rails session variable doesn't get set until page reload Posted: 07 Sep 2016 07:01 AM PDT I have a session variable that I want to set when a user hits the devise login page. Unfortunately it doesn't take effect after I get redirected. Instead, I have to refresh the page and then I see the new variable. I have tried a few things: First I tried just setting the session variable Then I tried deleting the old key and setting a new key: Both of these require a page refresh after I am redirected to the login form. My server logs are showing that the session variable is being picked up but the browser just doesn't seem to want to change it until I reload. Any help is greatly appreciated. |
Updating "Receipt" comments on a Shopify Order using ShopifyAPI::Fulfillment Posted: 07 Sep 2016 06:38 AM PDT I'm trying to update the I'm doing this: It saves it, but the order doesn't keep the save.. Not sure what I'm doing wrong, if anything. |
Posted: 07 Sep 2016 06:39 AM PDT I have a rails application where I am using kaminari for pagination. Somehow kaminari is using wrong url for hyperlinks. Right now I am looking for an easy fix which requires some regex & gsubbing. I have this url from kaminari: I want to replace this part - There could be any other string in place of How should I do this ? |
ruby on rails - if I have 2 models can I sort them both at once? Posted: 07 Sep 2016 06:38 AM PDT Let's say I have an Image model and a Video model how can I display them both in index by date |
Rails 4: How to prevent jumping to index Posted: 07 Sep 2016 06:45 AM PDT I am fairly new to rails and currently coding my first app. A URL overview: A code overview: Routes Tool Model Tools Controller Search View (app/views/tools/search.html.haml) Thanks for all helpful replies, appreciated! |
Rails: Choosing an object on button click and showing info on modal Posted: 07 Sep 2016 06:23 AM PDT I have a long list of cats in my database and on my web page I wish to open a Bootstrap modal with the information of only one cat in it. The id of the cat would be determined on button click. In my and the path How can this be done the Rails way? |
Ruby on Rails execute recurring task Posted: 07 Sep 2016 05:54 AM PDT I need to perform a task roughly every 1 minute on my rails application. So far I have tried delayed job (scheduling a job every minute Rails 3.1 on Heroku) with no success (runs only the one time and then stopped) and right now I'm trying with Sidetiq gem (https://github.com/endofunky/sidetiq). I have installed the gem and created the file here's the code that I put inside: I will perform some task in the official version but now I just insterted couple of prints. I have restarted the server, no errors but nothing happens, do you know what am I missing? One last note: the solution must be heroku compatible, because I don't have access to the crontab. |
How to pass arguments in I18n.translate Posted: 07 Sep 2016 05:45 AM PDT I18n.translate can translate error.messages like this: But there are some error messages that contains arguments like: Is it possible to pass the argument 'count' in the I18n.translate? |
Creating has_one association within the same model Posted: 07 Sep 2016 05:54 AM PDT Let us consider the below model. Now, the column1 can be any string, but column2 can be either null, or have values from column1. However column1 and column2 can't be same. I.E. column2 will be the foreign key and it will reference column1. How will i create a has_one relationship with these constraints. Something like, but the above mentioned doesn't work for me. |
Could performance issues imerge when using ActionCable in Production? Posted: 07 Sep 2016 06:24 AM PDT I'm planning to have a Rails App that has a very content rich interactive page where many users will connect to. Development has went well and small time testing on the Dev servers went without a hitch either. Problems started when we started alpha testing with selected groups of people. the sever would grind to a halt suddenly. Nginx would stop because of queue being full. I was at a lose for a while, but after looking around, came to the conclusion that the live actioncable was completely eating up my memory.This especially gets bad when the user reloads the page multiple times that subscribes to actioncable, causing additional process to become active, completely stopping the server, only being cured by a nginx reboot. I currently run a 2core 1GB memory SSD run VPS server for alpha testing, perhaps at tops 20 concurrent users.Should I be running into performance problems with such load? or should tuning the code or redis, passenger fix this? I know its hard to say any definitive things without more specifics, but could a ballpark estimate be done with the information? |
How set cookie sent from server to a client on a different port Posted: 07 Sep 2016 05:30 AM PDT I have a backend server (powered by Rails), whose APIs are used by a HTML5 frontend that runs on a Node simple development server. Both are on the same host: my machine. When I login from the frontend to the backend, rails sent me the session cookie. I can see it in the response headers, the problem is that browsers do not save it. Policies are right, If I serve the same frontend directly from the rails app cookies are set right. The only difference I can see is that when the frontend run on Node server, It runs on the port Any thoughts? solutions? (I need to be able to keep the setup this way, so to have the frontend served from Node and the backend on rails on different ports) |
Tool for slicing app into microservices Posted: 07 Sep 2016 05:31 AM PDT We've refactored our code a bit and I feel that we could separate some parts of our app into microservices. However it would be helpful to use a tool that would show me a graph of references between parts (directories) of our app. Our app is in Ruby on Rails. I know that I won't get 100% coverage of coupling between modules since ruby is a dynamic language... any graph would be useful though. |
Javascript / jQuery - Price calculation Posted: 07 Sep 2016 05:59 AM PDT I'm building an events app using Ruby on Rails. At the moment a user who wishes to book onto an event can only book and pay for one space at a time. I need to offer the facility for them to book multiple spaces and pay the appropriate price - so 5 spaces for £10 each = £50 to pay etc. I've looked for appropriate solutions in RoR to sort this but I'm hitting a brick wall. However, I believe I've perhaps approached this the wrong way and that a solution using javascript or jQuery is the best way forward. I'm very much a novice at both and need some assistance in achieving this objective. Here's my payment/booking page - I want a User to be able to place the number of spaces in the first text area and for the price (total amount) to change accordingly. Here's my other relevant code - bookings_controller.rb
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment