Lecturer in Lva eingebunden, Image thumb integriert
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
class Lecturer < ActiveRecord::Base
|
||||
attr_accessible :email, :name, :oid, :picture, :lva_ids
|
||||
attr_accessible :email, :name, :oid, :picture, :remove_picture, :picture_cache, :lva_ids, :link
|
||||
has_and_belongs_to_many :lvas
|
||||
mount_uploader :picture, PictureUploader
|
||||
resourcify
|
||||
end
|
||||
|
||||
@@ -1,10 +1,28 @@
|
||||
<%= semantic_form_for @lecturer do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :email %>
|
||||
<%= f.input :oid %>
|
||||
<%= f.input :picture, :as=>:file %>
|
||||
<%= f.input :lvas %>
|
||||
<%= f.input :link %>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<p>
|
||||
<label>Bild</label>
|
||||
<%= image_tag(@lecturer.picture.thumb.url) unless @lecturer.picture.nil? %>
|
||||
<%= f.file_field :picture %>
|
||||
<%= f.hidden_field :picture_cache %>
|
||||
</p>
|
||||
<p>
|
||||
<label>
|
||||
<%= f.check_box :remove_picture %>
|
||||
Bild Entfernen
|
||||
</label>
|
||||
</p>
|
||||
</div>
|
||||
<div class="span3">
|
||||
<%= f.input :lvas, :as=>:check_boxes%>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -1 +1,11 @@
|
||||
<h3><%= lec_lva.name %></h3>
|
||||
<div class="media">
|
||||
<a class="pull-left" href="#">
|
||||
<img class="media-object img" src="<%= lec_lva.picture.thumb.url %>"/>
|
||||
</a>
|
||||
<div class="media-body">
|
||||
<h4><%= link_to lec_lva.name, lec_lva %></h4>
|
||||
Email: <%= mail_to lec_lva.email %><br>
|
||||
TISS: <%= link_to lec_lva.name, lec_lva.link %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
5
db/migrate/20130821113333_add_link_to_lecturers.rb
Normal file
5
db/migrate/20130821113333_add_link_to_lecturers.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddLinkToLecturers < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :lecturers, :link, :string
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user