using data-rel tag, link to a div in dinamically process with Ruby on Rails | Fixed issues |
- using data-rel tag, link to a div in dinamically process with Ruby on Rails
- Rails file_filed doesn't pass params
- Rails 4 API, how to create a URL from a JSON response?
- Why won't my Angular app send params to my Entangle rails controller?
- Rails Mailer does not pick up on the host
- How do I save a carrierwave original image as a png but all versions as jpg?
- Rails5 - Ordering with Class method and params
- Access the radio-button from rails form in javascript
- Rails singleton client lost after a Rails crash
- Apply css on form collection
- Rails not passing the DB Query on search form
- How to store global api keys in Rails
- Angular not rendering ng-view if cookies are not set
- How to stub out Paperclip::AdapterRegistry::NoHandlerError?
- To get values from 2D array
- Attempting to iterate with ruby thru 4 twitter bootstrap columns
- ActiveRecord::StatementInvalid in Hr#internal_employee_page
- when i run ruby and rails code in sublime text i get an error [on hold]
- Test Auth0 Login with RSpec in Rails
- Customizable Button - Ruby on Rails
- Rails 4.2 ActionController:BadRequest custom error message
- fetch data from db based on static set in rails
- how can i optimise my spreadsheet report generation logic in rails?
- Rails 5 - ActiveAdmin can't use current_admin
- How to require jquery-waypoints-rails gem in application.js
- Database architecture for payment management application
- How can I return a Json in controller action
- Rails filtered parameters
- Call method from controller in view (ROR)
- Wicked PDF not rendering footer when PDF is created in model
using data-rel tag, link to a div in dinamically process with Ruby on Rails Posted: 30 Aug 2016 08:38 AM PDT I want to do a Facybox, using this method in the tutorial : http://sohtanaka.developpez.com/tutoriels/javascript/creez-fenetre-modale-avec-css-et-jquery/fichiers/ The problem is that the "data-rel" tag seems to don't work in dinamically circumstances. here is my code: The <%=product.title%> and <%product.image_url%> gives me always the same result : the first occurrence from my database. how could I fix it? Thanks! |
Rails file_filed doesn't pass params Posted: 30 Aug 2016 08:25 AM PDT I have trouble with my image update My form and controller my params from console i use What wrong with it? |
Rails 4 API, how to create a URL from a JSON response? Posted: 30 Aug 2016 08:42 AM PDT I'm working on an API where I have a few routes setup, ie http://localhost:3000/phone_number_lookup/1234567890 which can return a JSON response like so: The next 'step' of the API consumption would be, 'given the initially returned response, use 4 of those parameters and pass them into a remote URL that will then do something.' Like so: http://myremoteURL.com/Service/Param1?=sSerialNumber&Param2=iVideoSystemID&Param3=sMAC&Param4=ItemID It would be one thing to just set up a route that takes 4 parameters, but the route needs to be contingent on what the initial JSON response was. What is the proper way to do this? |
Why won't my Angular app send params to my Entangle rails controller? Posted: 30 Aug 2016 08:16 AM PDT In an effort to learn about realtime apps, I am trying to create a basic messageboard using Entangled. I have an Angular app and a Rails backend with a Messages Controller that includes Entangled::Controller. This Rails controller successfully receives a request when a form is submitted from the Angular app - the form is submitted using Entangled. (On clicking submit, a function is triggered in an Angular controller which should create a new message in the backend and update all clients subscribed to that backend.) I know the Angular function is being triggered on clicking submit, and I know the function receives the correct information from the form: The problem is that these fields are not arriving at the Rails controller. When I click submit, the correct action is triggered in the Rails controller, but the params don't contain the right information: I cannot work out what Entangled is doing with the username and content fields. Redis is new to me so I'm not sure if the problem is there. I have Redis installed and the redis-server is running as required by Entangled. I have a redis initializer as below, which in the Rails console is successfully connecting and letting me put data in the database: Here's my Angular controller: Message here refers to this factory: And here's my Angular view: Advice would be hugely appreciated - this has caused prolonged frustration and I'm very keen to get stuck into creating something with realtime updates. |
Rails Mailer does not pick up on the host Posted: 30 Aug 2016 08:04 AM PDT Site is in sub-directory In development.rb:
Url generated in the mailer
How to replace Rails: 4.1.15 |
How do I save a carrierwave original image as a png but all versions as jpg? Posted: 30 Aug 2016 07:57 AM PDT The original image that is uploaded is a png file with transparency. Upon upload, I would like to create multiple versions, all jpg filing in the transparency with white background, but keep the original as a png. The file names are UUID'd for CDN which will be enabled once I figure this out. I have used the recommended method for UUID per carrierwave docs and attempted to modify for my specific case. The uploader included below successfully uploads to s3. The hashed files appear to be correctly named -- they contain a hash as well as the correct extension.
Error 1 Images are stored in the db incorrectly. If I enter the rails console and attempt to output the image url the extension is '.png' even though the uploaded file in s3 is a '.jpg' Error 2 Looking at the file web_123-456-789.jpg in s3 and clicking 'properties' shows the content-type is 'image/png' I am using Carrierwave 0.11.2 so content-type is supposed to be set for me was my understanding. Uploader file |
Rails5 - Ordering with Class method and params Posted: 30 Aug 2016 07:38 AM PDT In Rails, I want to order some tweets by number of likes desc using I wrote a simple Class method in my model: And here is my method in my controller: If I only use Thank you ! |
Access the radio-button from rails form in javascript Posted: 30 Aug 2016 07:33 AM PDT I am building a rails app. I would like to access the radio_button value in Java Script(in document.getElementById). Below is the code snippet from the form.html.erb. Kindly let me know on how to access the same. I tried a lot of options. But nothing worked. |
Rails singleton client lost after a Rails crash Posted: 30 Aug 2016 07:28 AM PDT I have several third party APIs I need to connect to, so I have defined an abstract module for Singleton behavior, and the specific connector singleton isntances. My problem : everytime the Rails server crash (500 error, localhost), it seems I'm losing the @client instance variable of the connector I initialize my singleton in a Rails initializer The set of events |
Posted: 30 Aug 2016 08:27 AM PDT I'd like to apply this style on my collection : This is my current code with the collection I'd like to style (see the end of the form) : I don't know how to manage collection. I should isolate each tag to display it in Output |
Rails not passing the DB Query on search form Posted: 30 Aug 2016 07:21 AM PDT Here what looks better, this is the log, its passing the param, but its not passing a query with that param This is the controller: and this is the model: and the search form in the view: I have a _items.html.erb file which has the items to render, that part works because no matter my input on the search bar, it always shows all the items |
How to store global api keys in Rails Posted: 30 Aug 2016 07:35 AM PDT I have a global api key for authenticating the requests to my server's api. So the api key has to be stored somewhere in my rails application or on the server. After a quick search, most people seem to recommend to store your keys in a .yml file and load it in your application. They claim that this is safe because the .yml file is not checked to git/source control. Obviously you should add the .yml file to the .gitignore, otherwise it will be added git. But If you do that, then how can the file be loaded after deployment(capistrano) if the .yml file isn't checked in to git and doesn't exist on the server? Here is an example railscast that demonstrates storing the keys in .yml files: http://railscasts.com/episodes/85-yaml-configuration-file?autoplay=true |
Angular not rendering ng-view if cookies are not set Posted: 30 Aug 2016 07:14 AM PDT Very simple, but tricky bug. This are my controller settings: The problem is that if I erase the only cookie that I see to have registered, called _session_id, from chrome, then the ngView is not rendered: |
How to stub out Paperclip::AdapterRegistry::NoHandlerError? Posted: 30 Aug 2016 07:13 AM PDT I'm unit testing a controller. Looks like some magic goes on with paperclip with nested resources. Whenever How to stub out the paperclip magic whenever the Controller: Controller Spec: Result:^^^ How to stub this out? |
Posted: 30 Aug 2016 07:53 AM PDT I have used this query to retrieve the dates for one particular user's approved leaves - and I'm getting this array as result - what I want is to fetch all the dates as well as the dates between 12 Sep 2016 and 16 Sep, 2016 (13th 14th and 15th). |
Attempting to iterate with ruby thru 4 twitter bootstrap columns Posted: 30 Aug 2016 07:58 AM PDT enter link description hereI am attempting to iterate over a post object, and displaying its body attribute in 4 columns, as to behave like so: I have tried the following: The issue I'm having is that the 'body' content is running in to the adjoining column. Does anyone have any recommendations? |
ActiveRecord::StatementInvalid in Hr#internal_employee_page Posted: 30 Aug 2016 07:29 AM PDT I am learner ruby on rails,I want to join two model(tables). User.rb(users table) OfferLetter.rb(offer_letter table) HrController(hr_controller.rb) end when run my code I got error "Mysql2::Error: Unknown column 'offer_letters.user_id' in 'on clause': SELECT Error in this line : <% @employees.each do |emp| %> So tell me where i am wrong |
when i run ruby and rails code in sublime text i get an error [on hold] Posted: 30 Aug 2016 07:02 AM PDT here is the error when i wanted to build the project please tell how to set this problem C:/test-install/test.rb:1:in |
Test Auth0 Login with RSpec in Rails Posted: 30 Aug 2016 07:00 AM PDT I'm using Auth0 for authentication in my rails app. I need to write some feature tests for login and signup. I can't seem to find something concrete on how to do this with rspec and capybara. Tried doing something along the lines explained in this gist but it still doesn't work. If someone has had experience with rspec feature tests with Auth0 I'd appreciate if you would guide me in the right direction. Thanks! |
Customizable Button - Ruby on Rails Posted: 30 Aug 2016 07:00 AM PDT My website has several individual pages about courses and I need to create a button with a specific link for each course. I wanted it to show on every course page and want that the link can be changed on the administration framework by all admins and in case there's not a specific link, would show a default link. Any sugestions about how can I make this happen? I know this probably sounds confusing, apologies for my english. Thank you! |
Rails 4.2 ActionController:BadRequest custom error message Posted: 30 Aug 2016 07:07 AM PDT I want to return from my controller if either a validation failed or a parameter is missing with and i catch this error in my Application Controller with: But it seems like i cannot add custom messages when raising In the console i get the same behaviour. But
How can i add custom messages to the |
fetch data from db based on static set in rails Posted: 30 Aug 2016 07:34 AM PDT I want to fetch data from db based on static set in rails I have a data table with column values from the static data(data model) I have another table which is related to the data table and spl_value column(SPL model) How do i fetch spl_value from the static data? The expected Result is Rails Version is 3 |
how can i optimise my spreadsheet report generation logic in rails? Posted: 30 Aug 2016 06:39 AM PDT Here is the code currently i am using. its taking long time to generate the report. it seams there are so many database queries that are happening in loop in my rails application. how can i reduce my database queries, by refactoring the existing code so that a quick and nicely formatted report i can generate? my model associations are like this. employee has many in_outs, and in_outs belongs to employee. location has many employees, employee belongs to location. department has many employees, employee belongs to department. |
Rails 5 - ActiveAdmin can't use current_admin Posted: 30 Aug 2016 06:36 AM PDT here is my problem: I need an Admin system for A Ticket System, I already made the User Table via devise and the Admin Table, I juste added Active Admin after already created my own ticket system etc but now I wanna user ActiveAdmin, SO: I installed it correctly, I can connect with my Admin Table in it, and I just created my "Tickets" part, which gets all my tickets correctly, the tricky part is that I need to get the current_admin to display only the tickets from his service (commercial or technical..), but I can't access the current_admin method as it is defined in the initializer, not the current_admin_user or current_user or whatever the method could be named. I give you the code needed for good diagnostic: config/initializer/active_admin.rb: app/admin/ticket.rb And That's what raise the error: I Already saw and tried a bunch of solution which worked for others but I just can't make it works here.. Hope someone have already used it on Rails 5 and could help me cause i'm out of ideas. |
How to require jquery-waypoints-rails gem in application.js Posted: 30 Aug 2016 07:35 AM PDT My quetion is pretty much that, I can't find a way to require waypoints.js from the gem jquery-waypoints-rails inside my application.js. Thanks in advance. |
Database architecture for payment management application Posted: 30 Aug 2016 06:28 AM PDT I want to create application with handles reservations, yearly fees and training courses in my mountain club. I would like to organize my code to use Checkout class which will collect products like reservation or yearly fee or registration for course and then I will be able to create payment for them. Below is my idea how to achieve that but I am not sure if I should use polymorphism here. Are there somewhere best practices or examples for this kind of systems? |
How can I return a Json in controller action Posted: 30 Aug 2016 06:29 AM PDT I have this function in my controller: This function returns: How can I send it in json format? I have the example in php but I don't know how do it in rails. In php is this: |
Posted: 30 Aug 2016 06:16 AM PDT I am migrating my 4.2 app into Rails 5 and I run into a strange problem. When I try to log in via this: I got [FILTERED] log in server console, but I got params[:pasword] => "*****" in controller. Which is of course not matching password (I am using BCrypt). password encrypting: When I pass string "*****" into this method I got the same result as if I pass params[:password] there, which means the controller doesn't know about inserted password but gets only 5 asterisks. If I try this on my master branch with Rails 4.2.7 then in controller I can correctly see inserted password (in log there is "[FILTERED]" correctly). Do I miss some new feature about filtering parameters in Rails 5??? EDIT: I tried I got: |
Call method from controller in view (ROR) Posted: 30 Aug 2016 06:07 AM PDT I wanna call method from controller in view using the following code: but its giving error "undefined method `memmory' for #<#:0xb3bf71e8>" |
Wicked PDF not rendering footer when PDF is created in model Posted: 30 Aug 2016 05:55 AM PDT I'm using the wicked PDF gem to generate PDFs for my application. I have had some logic in my controller which has been generating PDFs with footers and page numbers for some time. I need to now generate this PDF in my model and since moving the controller render pdf code to the model, it hasn't been rendering a footer or proper margin. This is the code in my controller which works: I've moved the code to the model. It looks like the following: When comparing the two PDFs all of the data and styles within the template are the same. However, when rendering the PDF from the model it is not including the footer which has some text and page numbers. My footer is as follows: |
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