Add custom response header with Rack-cors and Grape | Fixed issues |
- Add custom response header with Rack-cors and Grape
- Execute Javascript when rendering .html.erb partial
- Sendgrid inbound parsing url API within rails
- Dealing with Time.now in Rails console
- ActiveRecord OR query (multiple conditions)
- Ruby Selenium / Page Object Model - launching Browser
- Jquery Chosen Plugin with Materializecss Design
- pagination with kaminari and mongoid
- Nested forms rails field does not update
- ruby version on remote server is not changed
- change a link_to with a modal
- DPRP is disabled. for this merchant in sandbox paypal
- ActiveAdmin Edit inputs missing attribute
- not getting first form in each loop
- Using UPSERT PostgreSQL from Rails 4.2
- Using bootstrap glyphicon in rails simple form attachment
- Rails use will_paginate with combined query results
- HTML, AJAX & ruby on rails message button
- Clockwork gem is trying to access development db in production
- RVM: how to get path to capistrano-installed gems
- SPA with rails-api and Angular JS
- Proxy URL stream to response
- Best way to handle reserved names in a Rails App
- Rails 4.0.3 - has_many through undefined method 'name' for nil:NilClass - only on production
- how to export the multiple data in csv forat which is strong in differnt db
- Best practices for integrating AuthenticityTokens in remote API's via React.js?
- How to define a nested has_one association?
- Sorting by values in a loop
- has_many through belongs_to with a has_many
- Rails: How to set the grandparent value (association) in ActiveRecord
Add custom response header with Rack-cors and Grape Posted: 04 Apr 2016 08:31 AM PDT I'm developing a Ionic(Cordova) app with a Ruby on Rails API. I want to use response headers to return a token after login. I'm using application.rb and grape gem to manage my API routes. But i can't find a way to add a header to my response since i added I tried this: But it doesn't work. Whatever i do i end up with those headers:
Can anyone help me with this issue ? |
Execute Javascript when rendering .html.erb partial Posted: 04 Apr 2016 08:20 AM PDT I have a In this partial, there is some javascript in a script tag, that does a few things in the step's form. However, on the /edit page of the post, the steps that were already created appear but don't have the behavior that the Javascript should create. I have this in my post form: And in the partial, at the bottom I have: But the last How can I execute the javascript code on the edit form for each step ? |
Sendgrid inbound parsing url API within rails Posted: 04 Apr 2016 08:18 AM PDT While there are many questions and answers on sendgrid inbound parsing configuration in this site, I could not find answer to my specific problem. In my SAAS app each customer can setup there own subdomain and also receive emails. I see that sendgrid provides API to create webhoooks with an api. How to accomplish this programicaly within rails? Documentation is here. https://sendgrid.com/docs/API_Reference/Web_API/parse_settings.html Thanks for your help. |
Dealing with Time.now in Rails console Posted: 04 Apr 2016 08:21 AM PDT I have a |
ActiveRecord OR query (multiple conditions) Posted: 04 Apr 2016 08:19 AM PDT How do I create an ActiveRecord query without using a SQL string in Rails to get something like: books = Book.where(author: 1, from_day: [1,5] or to_day: [1,5]) |
Ruby Selenium / Page Object Model - launching Browser Posted: 04 Apr 2016 08:05 AM PDT I'm learning selenium web-driver with ruby and page object model. My test code is below: When I run the test I get an error unable to locate element which is due to the page loading but not redirecting to the correct link. Usually I would use driver.gets but cant get it to work with page object model? With Page object model are you meant to have Page objects and methods in one class and then call the method using code below in another class? |
Jquery Chosen Plugin with Materializecss Design Posted: 04 Apr 2016 07:39 AM PDT Anybody has any clue about using jquery chosen plugin with materializecss design. |
pagination with kaminari and mongoid Posted: 04 Apr 2016 07:13 AM PDT I have this problem Controler view The mongo dont return the object. |
Nested forms rails field does not update Posted: 04 Apr 2016 07:15 AM PDT I am trying to do nested forms like mentioned here. http://guides.rubyonrails.org/form_helpers.html#nested-forms The goal is as follows: I have multiple colli with one checkbox which can be checked. The colli list can be deleted or modified but the checks and their information need to stay. Model So every colli has one check. The colliid from the colli table created a link with the check table using the subcontainer id. Controller Within the colli controller I whitelist the check_attributes. Form My form looks like this. If I do form_for :check I can't see the checkboxes. When I do form_for :checks I see a checkbox but it does not work. When clicking submit I see following error: Which means it did not get saved. Does anybody know how to fix this? |
ruby version on remote server is not changed Posted: 04 Apr 2016 08:33 AM PDT This is about configuring remote Ubuntu server through SSH utility for hosting Ruby on Rails application. From beginning I've installed all the environments using 'root' user, after installing tools I created other user - 'deploy' for Capistrano deployments. Now, when I connect to remote server with 'deploy' user account, for some reason it is showing Also, during deployment of the ruby application, it shows error that RAKE gem is not installed. I know for sure that RAKE and other Gems are installed. When logged in with deploy user credentials, the
Thanks in advance for all your help. |
Posted: 04 Apr 2016 08:26 AM PDT I'm working on a project where people can be hire on a job for an event. Actually they can only "postulate" but I wan't to add the option that they can add a price with their application. So here is my ancient code [working] : And I want to do something like this : But I have an error with autorisation maybe you could help me switching this link_to with a simple_form_for. Thank you in advance. EDIT : Message error You are not authorize to perform this action + Terminal ROUTES : MODEL PROJECT_JOB MODEL POSTULANT PostulantPolicy |
DPRP is disabled. for this merchant in sandbox paypal Posted: 04 Apr 2016 06:39 AM PDT I'm trying to integrate paypal payments through card into rails app. Normal one-time payments are working well. But I keep on getting the above response when I'm trying to make recurring payments. I've tried to enable that feature in paypal developer website but it says Note: Live credentials are disabled for direct credit card processing in your app. We are processing your information and will email you when live API credentials are enabled. But it is saying same from past few days. I've tried contacting them through online contact us but after three days they replied saying I have to add my credit card to the account. Do I need to add credit card for testing sandbox also? |
ActiveAdmin Edit inputs missing attribute Posted: 04 Apr 2016 06:36 AM PDT For some reason my "Edit" page for one of my model (chart.rb) is missing on of it's attributes. Simply adding to the chart.rb file will miss my attribute called If I add a special field for type like so It would properly render the type input in a nice format at another section below. Does anyone know why quick EDIT: I did a quick patch fix with the following code: Which rendered the form just fine. But when trying to save it, I got the following error in Rails:
Looks like the column name |
not getting first form in each loop Posted: 04 Apr 2016 07:47 AM PDT I have this type of each loop with form When i show this results in browser. First element of loop is without form and after that all element have form. After that I tried to add code and check form from inspect element in browser but in browser that is getting same issue that i can not see form in first element of loop. if anyone faced this type of issue then please help me to solve this. Thank you. |
Using UPSERT PostgreSQL from Rails 4.2 Posted: 04 Apr 2016 06:20 AM PDT How do I use "UPSERT" or "INSERT INTO likes (user_id,person_id) VALUES (32,64) ON CONFLICT (user_id,person_id) DO NOTHING" in PostgreSQL 9.5 on Rails 4.2? |
Using bootstrap glyphicon in rails simple form attachment Posted: 04 Apr 2016 06:38 AM PDT Hi all I use simple form. I have a model which contains attachment. Everything works fine except for I get a browse button in browser as shown in below image. Instead of Browse button I want bootstrap attachment glyphicon. How can I achieve this?. My code is below this image: |
Rails use will_paginate with combined query results Posted: 04 Apr 2016 06:34 AM PDT In my application I have a customers model that has many payments and invoices. In the customers show template I am combining all Invoices and Payments and storing them in the @transactions instance variable. I want to paginate @transactions using will_paginate. Doing this doesn't work: What is the best way to accomplish this? |
HTML, AJAX & ruby on rails message button Posted: 04 Apr 2016 06:14 AM PDT i would like to know how to structure the code to perform the following action, one of the page has only one 'submit' button, when User A pressed it, a message will be generated as 'User A pressed this button!". When User B pressed the button, a message generated as 'User B pressed this button!" the messages will appear like micropost in twitter, stacking each other, and all users can view this message. didn't manage to find guide for this simple coding anywhere, just want to know how to construct the 'submit' button to automatic send the string message based on different users. thanks. |
Clockwork gem is trying to access development db in production Posted: 04 Apr 2016 06:36 AM PDT I am trying to start the clockwork with following command |
RVM: how to get path to capistrano-installed gems Posted: 04 Apr 2016 06:10 AM PDT Please help before I go mad! I've followed these instructions to create wrappers for However, it turns out those gems don't exist under Capistrano is installing the gems in I'm not sure exactly how to resolve this... should I be creating wrappers that point to the gems created by Capistrano? Or should I be telling Capistrano to install gems in |
SPA with rails-api and Angular JS Posted: 04 Apr 2016 06:55 AM PDT recently I'm trying to use rails-api, I have a small project to develop and after seeing small demo of rails-api I thought it will be nice to use it as my server side. I found this tutorial:http://www.angularonrails.com/ruby-on-rails-angularjs-single-page-application/ but in this tutorial there are two separate servers and It's seems to me not like the right way to do this. couldn't find any good tutorial that explains how to use rails-api to serve the REST and tell the server also wo serve some html/css/js - so my angular SPA will run next to the services. I didn't try to use RubyOnRails since I have no use in the Views but maby Im wrong? so my question is: how can I create Single Page Application with rails-api (or ruby on rails)? with one server... |
Posted: 04 Apr 2016 06:06 AM PDT I need to proxy the url content to client. The url requires auth which is not available on client. Here is the Groovy code for the same (Implemented in Grails framework) - What will be the equivalent ruby code for the same in rails framework? |
Best way to handle reserved names in a Rails App Posted: 04 Apr 2016 06:32 AM PDT I am working on the model of a Rails app and half of the names I need to use are reserved (and they are also the ones that make more sense within the application. I don't want to find another name). What's the best way to handle this? I am thinking of using a prefix for all the models (for the ones with reserved words and not) My ideas for "Process": MyProcess TheProcess So whatever prefix I choose, I will use it for every model: MyUser TheUser Thanks! |
Rails 4.0.3 - has_many through undefined method 'name' for nil:NilClass - only on production Posted: 04 Apr 2016 07:39 AM PDT I have a branch model and a company model The company can have many branches through company_branches On my local machine everything works fine but when I try to save the form on my production Server I get: The call in my controller is @company.update_attributes(company_params) - The controller receives the branch_ids as array, like Interesting part of the controller(It fails at @company.update_attributes(company_params)): To clarify: I tried many things and currently only have one branch on my production server. Even with that one single branch I get the error when I try to save it. Edit: I posted the full stacktrace here: http://pastebin.com/tw6hjkyF |
how to export the multiple data in csv forat which is strong in differnt db Posted: 04 Apr 2016 07:48 AM PDT I have 4 different modules in each modules different data's but all the modules actions i have written in one controller, now i want to export the data 4 different else in one sheet only .... tell me how export in CSV format. Employee is the main controller in that only i have written all other actions.. personal_info , employee_qualification, Employee_proof, employee_skill, relatives these are the other modules now i need to be export the data in csv format |
Best practices for integrating AuthenticityTokens in remote API's via React.js? Posted: 04 Apr 2016 05:42 AM PDT I'm using React.js via TouchStoneJS ( a simple mobile Cordova framework ) to access a remote API ( that I own ). The form is relatively simple : Which I capture here, when they tap the Sign In button : My issue is that I'm not sure how to capture an authenticity token from my existing site. How can I still authenticate my requests without them being apart of the environment? |
How to define a nested has_one association? Posted: 04 Apr 2016 07:46 AM PDT Suppose we have this contrived model structure To avoid having to call Am I doing something wrong? Should I just define a getter method for :organism on Apple instances and be done with it? |
Posted: 04 Apr 2016 05:39 AM PDT I'm trying to store FIFA Games, and set a scoreboard with a ranking system. I shouldn't use logic in the view, but if I calculate them in the controller, it renders an error that the method user is not specified. When I put it in the loop, however, it recognizes it because the user is the looped item. The app can already save games and calculate the winner. The app adds Controller: VIEW: I'd like to put this list in the right order. The list should be ordered by ratio. => the @ratio from the view. Can I do this directly? In the first |
has_many through belongs_to with a has_many Posted: 04 Apr 2016 07:19 AM PDT This is what I want to achive: Is this possible without a jointable? Tried different combinations of class_name and source options to the has_many through but no success so far. Either I get stuck on a source not found even-though it was provided or I ends up in a mysterious Maybe someone can enlighten me if its even possible, when yes: how? best regards |
Rails: How to set the grandparent value (association) in ActiveRecord Posted: 04 Apr 2016 05:33 AM PDT How can I retrieve the data in the grandparent association. Give the following models: I'd like to get event.rb schema.rb When I try to execute this code, the following error appeared. development.log schedules_controller.erb I use It would be appreciated if you could give me how to get |
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