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
# Ways to execute a shell script in Ruby | |
# Example Script - Joseph Pecoraro | |
cmd = "echo 'hi'" # Sample string that can be used | |
# 1. Kernel#` - commonly called backticks - `cmd` | |
# This is like many other languages, including bash, PHP, and Perl | |
# Returns the result of the shell command | |
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
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 AlterUsers < ActiveRecord::Migration | |
def up | |
rename_table("users", "admin_users") | |
add_column("admin_users", "username", :string, :limit => 25 ) | |
change_column("admin_users", "email", :string, :limit => 100 ) | |
rename_column("admin_users", "password", "hashed_password") | |
add_column("admin_users", "salt", :string, :limit => 40 ) | |
puts "*********ABOUT TO ADD INDEX************" | |
add_index("admin_users", "username") | |
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
ActionView::Template::Error (No route matches {:action=>"create", :controller=>"post"}): | |
2: <%= link_to "<< back to list", "/posts" %> | |
3: | |
4: <section> | |
5: <%= form_for(:post, :url => {:action => 'create' }) do |f| %> | |
6: | |
7: <%= render :partial => 'form', :locals => {:f => f } %> | |
8: | |
app/views/post/new.html.erb:5:in `_app_views_post_new_html_erb___981529882650938543_70187893103800' |
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
Feature:Creating projects | |
In order to have projects to assign tickets to | |
As a user | |
I want to create them easily | |
Scenario:Creating a project | |
Given I am on the homepage | |
When I follow "New Project" | |
And I fill in "Name" with "Textmate 2" | |
And I press "Create Project" |
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
validates_presence_of :description, | |
:length => { :minimum => 10 } | |
validates :description,:presence => true, | |
:length => { :minimum => 10 } |
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
Ticketee::Application.routes.draw do | |
devise_for :users | |
resources :projects do | |
resources :tickets | |
end | |
root :to => "projects#index" | |
# The priority is based upon order of creation: |
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
fayimora [ticketee (master)]$ rake routes | |
root / {:controller=>"projects", :action=>"index"} | |
project_tickets GET /projects/:project_id/tickets(.:format) {:action=>"index", :controller=>"tickets"} | |
POST /projects/:project_id/tickets(.:format) {:action=>"create", :controller=>"tickets"} | |
new_project_ticket GET /projects/:project_id/tickets/new(.:format) {:action=>"new", :controller=>"tickets"} | |
edit_project_ticket GET /projects/:project_id/tickets/:id/edit(.:format) {:action=>"edit", :controller=>"tickets"} | |
project_ticket GET /projects/:project_id/tickets/:id(.:format) {:action=>"show", :controller=>"tickets"} | |
PUT /projects/:project_id/tickets/:id(.:format) {:action=>"update", :controller=>"tickets"} | |
DELETE /projects/:project_id/tickets/:id(.:format) {:action=>"destroy", :controller=> |
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
new_user_session GET /users/sign_in(.:format) {:action=>"new", :controller=>"devise/sessions"} | |
user_session POST /users/sign_in(.:format) {:action=>"create", :controller=>"devise/sessions"} | |
destroy_user_session DELETE /users/sign_out(.:format) {:action=>"destroy", :controller=>"devise/sessions"} | |
user_password POST /users/password(.:format) {:action=>"create", :controller=>"devise/passwords"} | |
new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"} | |
edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"} | |
PUT /users/password(.:format) {:action=>"update", :controller=>"devise/passwords"} | |
cancel_user_registration GET /users/cancel(.:format) {:action=>"canc |
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
<nav> | |
<%= link_to "Sign up", new_user_registration_path %> | |
</nav> | |
<%= link_to "New Project", new_project_path %> | |
<h2>Projects</h2> | |
<ul> | |
<% @projects.each do |project| %> | |
<li><%= link_to project.name, project %></li> | |
<%end%> | |
</ul> |
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 ProjectsController < ApplicationController | |
before_filter :find_project, :only => [:show, :edit, :update, :destroy] | |
def index | |
@projects = Project.all | |
end | |
def new | |
@project = Project.new | |
end |
OlderNewer