Klairvoyant infosolution's Blog

CSS Buttons

john

1) in css file

.button, .button:visited{
background: #222 url(overlay.png) repeat-x;
display: inline-block;
padding: 5px 10px 6px;
color: #fff;
text-decoration: none;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
-moz-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
-webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.6);
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
border-bottom: 1px solid rgba(0,0,0,0.25);
position: relative;
cursor: pointer
}
.small.button, .small.button:visited{ font-size: 11px}
.button, .button:visited,.medium.button, .medium.button:visited
{
font-size: 13px;
font-weight: bold;
line-height: 1;
text-shadow: 0 -1px 1px rgba(0,0,0,0.25);
}
.large.button, .large.button:visited
{
font-size: 14px;
padding: 8px 14px 9px;
}
.super.button, .super.button:visited
{
font-size: 34px;
padding: 8px 14px 9px;
}
.pink.button, .pink.button:visited{ background-color: #6b32b2; }
.pink.button:hover{ background-color: #44177c; }

2)
<a class=”super button pink”>Pink Button</a>
<a class=”large button...

Read more

paypal sandbox error:- This transaction cannot be processed due to an invalid merchant configuration.

john

Solution:-

while creating test merchant account select account type as “Website Payments Pro” instead of “seller”

Read more

Forms in rails, different ways

john

1) Method 1

a) input.html.erb

<form action=”/look/at”>
<input type=”text” name=’text1′>
<input type=”checkbox” name=”checkbox1″>
<input type=”radio” name=”radio1″ value=”red”>Red
<input type=”radio” name=”radio1″ value=”green”>Green
<input type=”radio” name=”radio1″ value=”blue”>Blue
<select name=”select1″>
<option value=’green’/> Green
<option value=’Blue’/> Blue
<option value=’Red’/> Red
<option value=’Orange’/> Orange
</select>
<select name=”select2[]” multiple size=”3″>
<option value=’AC’/> AC
<option value=’Music system’/> Music Syatem
<option value=’Heater’/> Heater
<option value=’auto...

Read more

Paypal with rails-Using Active merchant

john

) gem install activemerchant

2) create two paypal test accounts 1)Business 2) personal

copy the following information which will be created while creating business account

API Username,API Password and Signature

location:- https://developer.paypal.com/

3) code the following in a ruby file ex “purchase.rb”

require “rubygems”
require “active_merchant”

ActiveMerchant::Billing::Base.mode=:test

gateway=ActiveMerchant::Billing::PaypalGateway.new(
:login=> “API username”,
:password=>”API Password”,
:signature=>”signature”
)
# here the credit card information of the personal test account

credit_card=ActiveMerchant::Billing::CreditCard.new(
:type=>”visa”,
:number=>”4582849457729927″,
:verification_value=>”000″,
:month=>01,
:year=>2013,
:first_name=>”John”,
:last_name=>”M V”
)
if credit_card.valid?
...

Read more

Open Source Ruby On Rails Applications

john
Read more

IDE for rails

john
Read more

mentioning version and database for rails new project

john

rails _3.0.8_ new myproject -d mysql

where  -d for mentioning what database we use

Read more

How to get data from heroku to your system

john

1) Install the latest heroku gem
2) Install taps gem

3) execute the command heroku db:pull

for more
1) http://devcenter.heroku.com/articles/taps
2)http://blog.heroku.com/archives/2009/3/18/push_and_pull_databases_to_and_from_heroku/

 

Read more

ERROR: Could not find a valid gem ‘1.2.3.’ (>= 0) in any repository

john

Install  as the following form

gem install rack –version=1.2.3.

where rack is the gem we want to install

 

Read more

activated rack ..., but your Gemfile requires rack ..... Consider using bundle exec. (Gem::LoadError)

john

When it says try using bundle exec… it means that you have to prefix the command with that

Example if  “cucumber features” display the error

“bundle exec cucumber features”

 

Read more

RVM use

john

RVM make installing multiple ruby interpreters / runtimes easy and consistent, it provides features such as gemsets that aren’t typically supported out of the box on most ruby installs.

Read more

include and require in rails

john

require

The require keyword includes files in your include path (e.g., lib, your Ruby load path, and so on).

include

The include keyword mixes modules into classes, so it needs to be inside a class to be used.

Read more

passing variables to the partial in rails

john

There is a bit of magic involved in passing variables to the partial. Because the partial is named “person,” the main template will look for an instance variable @person, and pass it to the partial as a local variable, person. What if the instance variable doesn’t match the name of the partial? Then you’d explicitly pass it, like this: “person”, :locals => { :person => @scott } %>All the key/value pairs in the :locals hash will be made into local variables for the partial.

Read more

Rails Tools

john

cucumber- behavior driven development in rails

BDD focuses on obtaining a clear understanding of desired software behavior through discussion with stakeholders. It extends TDD by writing test cases in a natural language that non-programmers can read. Behavior-driven developers use their native language in combination with the ubiquitous language of domain driven design to describe the purpose and benefit of their code. This allows the developers to focus on why the code should be created, rather than the technical details, and minimizes translation between the technical language in which the code is written and the domain language spoken by the business, users, stakeholders, project management, etc.

HAML to HTML converter

http://haml-lang.com/try.html

HTML to HAML converter

http://html2haml.heroku.com/

CSS to SASS Converter

http://css2sass.heroku.com/

JavaScript to CoffeeScript Converter

http://js2coffee.org/

http://js2cs.nodejitsu.com/

Anemone

Anemone is a free, multi-threaded Ruby...

Read more

What is Heroku ?

john

Heroku is a multi-tenant platform and hosting environment. Your app doesn’t need its own servers, slices, or clusters, and you’ll benefit from continuous platform improvements.

For Implementation go to

http://devcenter.heroku.com/articles/quickstart

Read more