Just uploaded this pack of images as slideshow on slideshare.net. Have a look at these
View more presentations from Praveen Sinha.
aren't these nice??
<%=link_to_remote "Export the result",:url => {:controller => "some_controller", :action => "ask_to_export"},:with => "'record_ids=1-2-3-4-5-6'" -%>
def ask_to_export
render :update do |page|
page.redirect_to :action => "process_and_export", :record_ids => params[:record_ids]
end
end
def process_and_export
outfile = ""
CSV::Writer.generate(outfile) do |csv|
csv << ["praveen","kumar","sinha",1,2,3,nil,""]
end
send_data outfile, :type => 'text/csv; charset=iso-8859-1; header=present', :disposition => "attachment; filename=report_#{Time.now.to_f.to_s}.csv"
end


sudo aptitude install ssl-cert
sudo make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /path/to/ssl/certictare/selfsigned.pem
sudo a2enmod ssl
sudo a2enmod proxy
sudo a2enmod rewrite
sudo a2enmod proxy_balancer
sudo a2enmod proxy_http
sudo a2enmod headers
cd /etc/apache2
sudo a2dissite default#create a new configuration for virtual host by copying the default site configuration and (rename 'ourapplication' with your application name)
sudo cp sites-available/default sites-available/ourapplication#to enable our application site configuration in apache
sudo a2ensite ourapplication
sudo gedit /etc/apache2/sites-available/ourapplication
<VirtualHost *:80>
ServerName ourapplication
ProxyPass / http://somename.com:3000/
ProxyPassReverse / http://somename.com:3000/
</VirtualHost>
<VirtualHost *:443>
ServerName ourapplication
ProxyPass / http://somename.com:3000/
ProxyPassReverse / http://somename.com:3000/
ProxyPreserveHost On
RequestHeader set X_FORWARDED_PROTO 'https'
SSLEngine On
SSLProxyEngine On
SSLCertificateFile /path/to/self/signed/certificate/selfsigned.pem
SSLProxyMachineCertificateFile /path/to/self/signed/certificate/selfsigned.pem
</VirtualHost>
sudo gedit /etc/apache2/mods-available/proxy.conf
<proxy>to new proxy setting
AddDefaultCharset off
Order deny,allow
Deny from all
Allow from .example.com
</proxy>
<proxy>
AddDefaultCharset off
Order deny,allow
Allow from all
</proxy>
sudo /etc/init.d/apache2 force-reload(but it should not give any error, and it will not if no wrong is done to it form the above mentioned procedures)
* Reloading web server config apache2
apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
ruby script/plugin install ssl_requirement
include SslRequirement
class EcommerceController < ApplicationController
ssl_required :action_name_1, :action_name_2, :action_name_3
# some more codes..............
end
<% form_tag url_for(:controller => "controller_name", :action => "action_name") do %>
<%@some_collection_hash.each do |key,value| -%>
<span><%=key%></span>
<%value.each do |single_item|-%>
<div class="sbc" style="width:30px;">
<%=radio_button_tag("publisher[#{key}]", single_item.id,false,:disabled => (single_item.status != "valid")) -%>
</div>
<div class="sbc" id="<%=single_item.id-%>_batch">
<%=render :partial => "/xyz/partial_one", :locals => {:single_item => single_item, :key => key} -%>
</div>
<%end-%>
<%end-%>
<%= submit_tag "Get Summary"%>
<% end %>
<ul>
<li class="head_li">Satus:</li>
<li class="dotless_li">
<%=select_tag("#{single_item_id}_status", options_for_select(["valid","invalid","pending","running","deleted","summarize"],@single_item.status)) %>
</li>
</ul>
<ul>
<li class="head_li">Description:</li>
<li class="dotless_li"><%=text_area_tag "#{single_item_id}_desc", @single_item.comments, :rows => 3, :cols => 30 -%></li>
</ul>
<input type="button" value="Close" onclick="<%= remote_function(:update => "options",
:url => {:controller=> :controller_name, :action => :show_single_iteminfo ,:single_item_id => single_item_id, :key => key},
:update => { :success => "#{single_item_id}_single_item", :failure => "#{single_item_id}_single_item" }) -%>" />
<input type="button" value="Save" onclick="<%= remote_function(:update => "options",
:url => {:controller=> :controller_name, :action => :save_single_iteminfo ,:single_item_id => single_item_id, :key => key},
:with => "'description='+$F('#{single_item_id}_desc')+'&'+'status='+$F('#{single_item_id}_status')",
:update => { :success => "#{single_item_id}_single_item", :failure => "#{single_item_id}_single_item" }) -%>" />


Hello Friends, Got a post again on to Honda Civic (The good old favorite commuter of mine). This car has been doing great except for so...