This file contains hidden or 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 PostsController < ApplicationController | |
# GET /posts | |
# GET /posts.json | |
def index | |
@posts = Post.all | |
respond_to do |format| | |
format.html # index.html.erb | |
format.json { render json: @posts } |
This file contains hidden or 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
require 'sinatra' | |
set :public_folder, 'public' | |
get '/' do | |
haml :index | |
end | |
post '/upload' do | |
File.open('public/uploads/' + params['file'][:filename], "w") do |f| |
This file contains hidden or 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
- @files.each_with_index do |file, index, customer_dir| | |
%tr | |
%th= File.basename(file.path) | |
%th= "#{to_mb(file.size)} MB" | |
%th | |
%a{:id => "file#{index}", :href => "/uploads/#{File.basename(file.path)}"} | |
= "/uploads/#{customer_dir}/#{File.basename(file.path)}" | |
%a{:id => "back", :href => "/"} | |
= "Back" |
This file contains hidden or 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
%body | |
%h1 ipa Datei auswaehlen und hochladen | |
%form#upload{ :enctype => "multipart/form-data", :action => "/upload", :method => "post"} | |
%input{ :name=> "file", :type => "file"} | |
%label{ :for => "message[customer_dir]"}Kunde: | |
%input{ :type => "text", :customer_dir => "Kunde" } | |
%input{ :type=> "submit", :value => "Upload"} |
This file contains hidden or 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
2 TAGE * 24 SPRECHER * 400 TEILNEHMER | |
Willkommen bei der Macoun App. Die Macoun ist die größte Konferenz für iOS und OS X Entwickler im deutschsprachigen Raum. | |
Mit der App hast Du die Konferenz im Griff. Stelle Dir deinen persönlichen Konferenz Fahrplan zusammen und schau nach wer mit Dir zusammen einen Vortrag besucht. Lasse Dich per Push Mitteilungen von den Organisatoren über Neuigkeiten informieren. | |
Erfahre auf den Detailseiten mehr über die Sprecher und deren Vortragsthema. |
This file contains hidden or 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
<div data-role="page"> | |
<div data-role="header"> | |
<a href="import.html" data-rel="back" data-direction="reverse" data-icon="arrow-l">Lorem ipsum</a> | |
<h1>Title</h1> | |
</div><!-- /header --> | |
<div data-role="content"> | |
<p>Lorem ipsum</p> | |
<p> | |
<!-- <img class="boximage" src="images/screen_playlist_add.png" /> --> |
This file contains hidden or 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
== CreateCustomers: migrating ================================================ | |
-- create_table(:customers) | |
rake aborted! | |
An error has occurred, this and all later migrations canceled: | |
SQLite3::SQLException: table "customers" already exists: CREATE TABLE "customers" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "email" varchar(255), "customer_number" varchar(255), "contact_person" varchar(255), "street" varchar(255), "zip_code" integer, "location" varchar(255), "country" varchar(255), "created_at" datetime, "updated_at" datetime) |
This file contains hidden or 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
rails g migration AddCustomerAppointmentToReport customer_appointment:date | |
## migration file | |
class AddCustomerAppointmentToReport < ActiveRecord::Migration | |
def self.up | |
add_column :reports, :customer_appointment, :date | |
end | |
def self.down |
This file contains hidden or 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_for @report do |f| %> | |
<%= f.error_messages %> | |
<p> | |
<%= f.label :technician_id %><br /> | |
<%= f.text_field :technician_id %> | |
</p> | |
<p> | |
<%= f.label :title %><br /> | |
<%= f.text_field :title %> | |
</p> |
This file contains hidden or 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 Technician < ActiveRecord::Base | |
attr_accessible :name, :email | |
has_many :@reports | |
end | |
class Report < ActiveRecord::Base | |
attr_accessible :technician_id, :title, :problem | |
belongs_to :technician | |