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
Routing Error | |
No route matches {:action=>"edit", :controller=>"admin/advice_pages"} |
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
Started GET "/admin/investors/2" for 192.168.233.1 at 2011-12-23 11:01:45 +0100 | |
Processing by Admin::InvestorsController#show as HTML | |
Parameters: {"id"=>"2"} | |
User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1 | |
Investor Load (0.3ms) SELECT "investors".* FROM "investors" WHERE "investors"."id" = ? LIMIT 1 [["id", "2"]] | |
Completed 406 Not Acceptable in 52ms | |
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
cd ~ | |
sudo apt-get install unzip | |
sudo apt-get install python-software-properties -y | |
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner" | |
sudo apt-get update | |
sudo apt-get install sun-java6-jre sun-java6-plugin -y | |
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.6.tar.gz -O elasticsearch.tar.gz | |
tar -xf elasticsearch.tar.gz | |
rm elasticsearch.tar.gz |
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 Employee < ActiveRecord::Base | |
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i # full regex | |
validates :name, :presence => true | |
validates :title, :presence => true | |
validates :email, :presence => true, :format => { :with => email_regex } | |
validates :phone, :presence => true | |
validates :image, :presence => true | |
def as_json(options={}) |
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
[PS] C:\Windows\system32>Get-GlobalAddressList | |
Name RecipientFilter | |
---- --------------- | |
Default Global Address List (Alias -ne $null -and (ObjectClass -eq | |
'user' -or ObjectClass -eq 'contact' -o | |
r ObjectClass -eq 'msExchSystemMailbox' | |
-or ObjectClass -eq 'msExchDynamicDist | |
ributionList' -or ObjectClass -eq 'grou | |
p' -or ObjectClass -eq 'publicFolder')) |
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
[PS] C:\Windows\system32>Update-GlobalAddressList -Identity "EDORAHQ" | |
Update-GlobalAddressList : The operation could not be performed because object | |
'EDORAHQ' could not be found on domain controller 'ESDKLY002.edora.hq'. | |
At line:1 char:25 | |
+ Update-GlobalAddressList <<<< -Identity "EDORAHQ" | |
+ CategoryInfo : NotSpecified: (0:Int32) [Update-GlobalAddressLis | |
t], ManagementObjectNotFoundException | |
+ FullyQualifiedErrorId : A404880B,Microsoft.Exchange.Management.SystemCon | |
figurationTasks.UpdateGlobalAddressList |
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
- @rss.entries.each do |rss| | |
%li | |
%b= rss.pubDate.strftime('%d/%m/%y - %H:%M:%S') | |
%br/ | |
= link_to(truncate(rss.title, :length => 50), rss.link) |
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 Admin::AdvicePagesController < AdminController | |
def index | |
@pages = AdvicePage.all | |
end | |
def show | |
@page = AdvicePage.find(params[:id]) | |
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
# IN ADMIN NAMESPACE | |
# IVE TRIED WORKING IN THE MERCURY_UPDATE METHOD IN HERE BUT NO LUCK | |
# | |
class Admin::AdvicePagesController < AdminController | |
def index | |
@pages = AdvicePage.all | |
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
def initialize(user) | |
user ||= User.new | |
if user.super_admin? | |
can :manage, :all | |
elsif user.admin? | |
can :manage, News | |
can :manage, Video | |
can :manage, Employee |