Send_file open file in browse instead of download it | Fixed issues |
- Send_file open file in browse instead of download it
- How to learn Ruby on Rails *Source Code*? [on hold]
- Rails routes resources - add extra param on all routes
- Retrieving attributes of associated object Rails
- SQLite3::BusyException: database is locked: INSERT INTO
- Get list of all regitered connections
- keep changed style by javascript after showing flash error message in ruby on rails
- Impossible to display the image uploaded with paperclip
- Display filters prams when selected
- Rails: belongs_to twice on same field
- Rails Sunspot - not working search
- Bind error message on another attribute
- Rails - two forms in one (ShopifyAPI)
- Add a title to my select_tag
- Ruby on Rails error when validates_uniqueness_of using collection_select
- Confirm popup not working
- Ajax fires up multiple times unless page is Reloaded, Rails 4 and Bootstrap
- Rails 5 - limit selection of associated object
- Rails - NoMethodError undefined method `>=' for nil:NilClass
- Rails shuffle with priority
- Rails, access an array inside of GooglePlaces::Spot
- Ruby on Rails pending on link_to
- Why did Rails 5 changed "index" to "foreign key"?
- how to write condition on includes in mongoid?
- Rails 5 Session on all domain
- Select table rows which have corresponding rows in another table
- Ruby on Rails issues a Nil on Roo::CSV class
- Issues with a nested element's destruction
- Ruby on Rails - Showing different code (button) every 2 user
- javascript is not working in rails4.2?
Send_file open file in browse instead of download it Posted: 29 Sep 2016 07:55 AM PDT please tell me how it's work, coz i'm don't understand... My simple code Route My actinon and download link So, when i'm clicking on the link I get this http://joxi.ru/GrqvQ3xHlbaYmz it's seems like browser try to show zip file content... But when I open my action from browser (or refresh page) it's work fine Why it's don't work when I click on the link generated by link_to (it open http://joxi.ru/GrqvQ3xHlbaYmz ? |
How to learn Ruby on Rails *Source Code*? [on hold] Posted: 29 Sep 2016 07:50 AM PDT There are many tutorial on the web teach about how to use Ruby on Rails I really want know how Ruby on Rails work under the hood, Where should I start? Learn about what is gem? and then what is rack? and then what? Am I asking the wrong question? |
Rails routes resources - add extra param on all routes Posted: 29 Sep 2016 07:49 AM PDT I wanna generate some routes for my scaffold, but in some way that all of then looks something like: so I can catch that "type" param on my controllers. I don't wanna do it manually... Is there some way to easily add that :type param? Thanks! |
Retrieving attributes of associated object Rails Posted: 29 Sep 2016 07:39 AM PDT I have a post that has many comments. Comments have a body and a title In the code above you can see that I try to get the body attribute from the post that has a comment, but I get a no method exception. How do I retrieve the associated objects data in these types of situations? |
SQLite3::BusyException: database is locked: INSERT INTO Posted: 29 Sep 2016 07:54 AM PDT When I run this piece of code with a task, it works When I run it with a MVC, I have the following message : ActiveRecord::StatementInvalid (SQLite3::BusyException: database is locked: I have put the above code in a function in the Gss model. The import is launched from the browser with a GET that is routed to the controller that calls the model import function When the import is finished, the complete list of record should then be returned to the view. the csv file has 4k rows. The process of importing takes time and it seems that after precisely 60 seconds the GET is resend. Can someone explain me how to avoid this resending that crashes the import ? |
Get list of all regitered connections Posted: 29 Sep 2016 07:28 AM PDT http://stackoverflow.com/a/36230416/5381547 http://stackoverflow.com/a/32945949/5381547 Those answers don't help me. I want to get list of all registered connections to my ActionCable. I tried
and
but they both return But I know that this is a totaly not Rails-way. Is there any possibility to get a list of all registered connections? |
keep changed style by javascript after showing flash error message in ruby on rails Posted: 29 Sep 2016 07:27 AM PDT I have a div part in my HTML(erb), whose display is "none" at first. Then I change its style to "block" detecting the input values of datetimepicker. I have succeeded to change the style, but the style reverses to "none" if the form gets flash error message shown after validation. Is there any way to keep the style changed even after error message shows up. Here is my code of javascript. I tried to put the line below after "$('#hotel').fadeIn(500); " but it doesn't work. Could anyone tells me the best way?? |
Impossible to display the image uploaded with paperclip Posted: 29 Sep 2016 07:54 AM PDT I got a problem with paperclip, I just can't display the image who has been uploaded, here is my code : images_controller.rb : My migration generate with paperclip my model image.rb: my view create.html.erb: and my routes.rb I don't know why I can't upload any files, the display look like this : http://hpics.li/131d722 I just tried with a new project and it work but with this code , it doesnt work, I think the path of the image is wrong maybe, but im not sure and I don't know how to fix it. Thanks in advance for your help. |
Display filters prams when selected Posted: 29 Sep 2016 07:23 AM PDT I m making an rails app. I have search function with params and i want to display in my view filters params when they are slected but i dont know how i can do that. Image is better than words so i want this http://img4.hostingpics.net/thumbs/mini_398032filterparams.jpg or image 2 camping_controller.rb resultnohome.html.erb _searchfilter.html.erb So my question is : How i can do that ? Thanks for your help ! |
Rails: belongs_to twice on same field Posted: 29 Sep 2016 07:23 AM PDT Please, anyone know, can I declare relation For example: In this way, I have use |
Rails Sunspot - not working search Posted: 29 Sep 2016 07:06 AM PDT I added a sunspot gem into my rails app and my model looks like this: I run the commands as the docs said (with reindex command included). After doing: the @results is an empty array, and I do have a record with name containing "laboratory". I do not see any error, so what did I do wrong? |
Bind error message on another attribute Posted: 29 Sep 2016 07:08 AM PDT I have the following validation rule in a model In the form view (simple_form), the following code generates the file upload field: The validation works, but the error message is not shown at the upload field. I think, the reason is, that the validation is for :csv_fingerprint and the form field is :csv. How can I tell the validation rule, that the message should be displayed at the :csv field? |
Rails - two forms in one (ShopifyAPI) Posted: 29 Sep 2016 07:33 AM PDT Part of the app i'm developing involves a form which has to create a product on the users shopify store and also create a row in my own database for an identical product (with a few extra bits of information). Where i'm struggling is with the form itself, i can do this with a html based form, but i can't get a single ruby form to do both jobs. A shortened version of my controller create code is as follows; So as you can see i'm using the same params to set values for both the shopify product and the product in my own db. The HTML form looks like this: And it works fine, but how do i convert this into a ruby form that does the same job? |
Posted: 29 Sep 2016 07:46 AM PDT I am trying to put a title to my thanks for your help |
Ruby on Rails error when validates_uniqueness_of using collection_select Posted: 29 Sep 2016 06:59 AM PDT First, sorry for my bad English. I'm still learning. I have 3 tables in my DB: Problem
Solution
Register
The system is working well. I am able to insert new data in all of the 3 tables. In the views for the table/model The problem only appears when I try to add this validation to Then I get: And I dont know why. So, I tried to do the validation by the controller: But the error remains. I believe that the cause is the collection_select, but I don't know how to solve it. Saying one more time, I am able to persist date in all the 3 DB tables. But when I try to avoid duplication, the error appears. |
Posted: 29 Sep 2016 06:20 AM PDT I have a problem as the confirm popup is not showing, when i use my delete button. The deleting works fine, i just dont get the "are you sure" popup first. I have tried different variantions of this code, without any luck. I think i have the confirm part correct, but perhaps not. What am i missing here? |
Ajax fires up multiple times unless page is Reloaded, Rails 4 and Bootstrap Posted: 29 Sep 2016 06:10 AM PDT I have simple app with index and show pages. Pretty simple code and etc. Simple registration that is handled with Devise gem. In index page I have such Bootstrap modal for registration: At the end of the Application_layout file: Registration process is handled with remote => true. script.js: Application.js file: Problem: Unless I refresh page before triggering modal and filling in form, submitting form triggers 2 identical requests. If I visit show page and then come back to index page to register form submitting triggers 4 identical requests. Basically, each time user visits show page number of requests increases by 2. At the end requests can go up to 10 and more. After reloading page everything is back to normal. The same problem occurs when I click on page logo that sends to root_path that is basically the same index page. And the cycle continues. What I tried: 1) Deleted every other script from scripts.js file except the script for handling registration process (see above for script) 2) Changed all click elements to 3) Removed every other Bootstrap modal from my page so the conflict possibility could be excluded. 4) Double checked page source for index and show page to check if 5) I have cleared tmp/assets folder. 6) Problem happens on all browsers. Note: This problem occurs on every ajax request. In my app I have lot of modals with ajax submitting and every of them have the same problem unless I reload page each time. I have run out of options to try. Thank you in advance for any help. |
Rails 5 - limit selection of associated object Posted: 29 Sep 2016 07:18 AM PDT In my app that I am building to learn RoR, I have Annotation (for documents of a document type) with tags (much like posts and comments). When adding a tag to an annotation, I want to limited the possible types of the tag to those tag types that have the same document type as the document type of the annotation. To reduce the list of tag types I already use a scope to get active tag types. Like so: with this scope How can I extend it for matching document types? If with a scope, how; if not, what approach should I take then? |
Rails - NoMethodError undefined method `>=' for nil:NilClass Posted: 29 Sep 2016 06:33 AM PDT I'm getting the above error in my model. Here's the model code - Booking.rb
Subscribe to:
Post Comments (Atom)
|
No comments:
Post a Comment