Skip to content

Instantly share code, notes, and snippets.

View vamsipavanmahesh's full-sized avatar

vamsi pavan mahesh gunturu vamsipavanmahesh

View GitHub Profile
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
#
default: &default
adapter: postgresql
pool: 5
timeout: 5000
Hey I am trying to one-one relation in active record ..
I have a model called person
class Person < ActiveRecord::Base
has_one :personal_info
end
whose migration is like this
I am trying to use wicked gem .. so that I can capture the fields in multiple forms, instead of a single form
Here is what I did ..
In routes
resources :user_steps
generated a controller user_steps ..
<div class="col-md-12 col-sm-12 pad-0 col-hover">
<div class="col-md-2 col-sm-2 pad-10">
<img class="img1" src="/assets/choose-style/img2.png">
</div>
<div class="col-md-8 col-sm-8">
<h5><%= CaricatureType.second.name %></h5>
<p class="text-color">
<%= CaricatureType.second.description %>
</p>
</div>
Processing by OrderDetailsController#update as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"z4V0Rd/2iypIQCCTWMo8z4PhUUeDRlrbeJUAN/i8jY0oukAerCQHq1YjFTS8K+zxoKGBq2KlQdhMX+a/saQjlg==", "studio_order"=>{"occasion_id"=>"2", "user_id"=>"2"}, "button"=>"", "id"=>"choose_occasion"}
[9, 18] in /home/gvpmahesh/code/shij/core/app/controllers/order_details_controller.rb
9: end
10:
11:
12: def update
13: byebug
=> 14: if StudioOrder.find_by(user_id: spree_current_user.id)
<form action="/purchase" method="POST">
<script
src="https://checkout.razorpay.com/v1/checkout.js"
data-key="<%= "#{Figaro.env.MERCHANT_KEY_ID}" %>"
data-amount="<%= "#{@product.price}" %>"
data-name="<%= "#{@product.seller.name}" %>"
data-description="<%= "#{@product.description}" %>"
data-image="/images/product.jpg"
data-prefill.name="<%= "#{current_user.name}" %>"
data-prefill.email="<%= "#{current_user.email}" %>"
$(document).ready(function(){
var options = {
"key": "<%= "#{Figaro.env.MERCHANT_KEY_ID}" %>",
"amount": "<%= "#{@product.price}" %>",
"name": "<%= "#{@product.seller.name}" %>",
"description": "<%= "#{@product.description}" %>",
"image": "/images/product.jpg",
"handler": function (response){
var mapForm = document.createElement("form");
mapForm.target = "_self";
require 'pusher'
class CheckPushController < ApplicationController
def show
pusher_client = Pusher::Client.new(
app_id: 'xxx',
key: 'xxx',
secret: 'xxx'
require 'razorpay'
class PaymentController < ApplicationController
# TODO talk to razorpay, looks like vuneralibility
skip_before_action :verify_authenticity_token
before_action :set_payment_id, only: [:update]
def update
payment_obj = Razorpay::Payment.fetch(@payment_id)
<form accept-charset="UTF-8" action="/payment" method="POST">
<script
src="https://checkout.razorpay.com/v1/checkout.js"
data-key="<%= ENV['MERCHANT_KEY'] %>"
data-amount="100"
data-name="Shareconomy"
data-description="Nothing"
data-image="http://4.bp.blogspot.com/-9uviR4AGp_A/UnuoDQ4ZMAI/AAAAAAAAALQ/3ceF5N2V14Q/s1600/shijokes.jpg"
data-prefill.name=""
data-prefill.email="gvpmahesh@gmail.com"