This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GroupsController < ApplicationController | |
def index | |
@groups = Group.all | |
end | |
def show | |
@group = Group.find(params[:id]) | |
#@posts = @group.posts | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project Path : /home/poc/Dropbox/Ruby/zeus | |
poc@ubuntu:zeus$ which ruby | |
/home/poc/.rvm/rubies/ruby-1.9.3-p448/bin/ruby | |
poc@ubuntu:zeus$ gem list | |
*** LOCAL GEMS *** | |
actionmailer (4.0.0, 3.2.12) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create_table "translates", :force => true do |t| | |
t.string "translate_str" | |
t.string "EN" | |
t.string "DE" | |
t.string "ES" | |
t.string "FR" | |
t.string "IT" | |
t.string "JP" | |
t.string "PT" | |
t.string "CN" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= form_tag translate_search_path, :method => :get do %> | |
<%= text_field_tag :search %> | |
<%= submit_tag 'Search_key' %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<% if [email protected]? %> | |
<% @results.each do |result| %> | |
<li> | |
<%= result %> | |
</li> | |
<% end %> | |
<% else %> | |
<%= @results.inspect %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Categorization < ActiveRecord::Base | |
attr_accessible :category_id, :product_id | |
belongs_to :product | |
belongs_to :category | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= f.hidden_field :user_id, :value => current_user.id %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
config.action_mailer.default_url_options = { :host => '172.16.77.88:3000' } | |
#remmembe to set in production.rb ,also |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fine Group and Subgroup, in <p> tag | |
grp_list=['Group','Subgroup'] | |
grps = soup.find('body').findAll('p',text =re.compile('|'.join(grp_list))) | |
#remove \r\n , special characters by split + join | |
# 8. Useful\r\nFunctions' => 8. Useful Functions | |
print( ' '.join(belong_to_chap.split())) | |
OlderNewer