-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ace8ac
commit b3770a7
Showing
6 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Product < ActiveRecord::Base | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<div style="padding-top:100px;padding-left:100px;"> | ||
<%= image_tag @inplace_image.data :default %> | ||
|
||
<div> | ||
<%= link_to "Кропать?", test_crop_image_url(@inplace_image) %> | ||
</div> | ||
<div style="padding-top:100px;"> | ||
Перезагрузить фотку | ||
<% form_for @inplace_image, :inplace_image, :url=> reupload_image_url(:id=>@inplace_image.id), :html=>{:multipart=>true} do |form| %> | ||
<div> | ||
<%= form.error_messages %> | ||
</div> | ||
<div> | ||
Укажите alias | ||
</div> | ||
<div> | ||
|
||
<input type="text" name="alias" value="<%= @inplace_image.alias %>"> | ||
</div> | ||
|
||
<!--<div>--> | ||
<!--Укажите тип геометрии(например mainpage)--> | ||
<!--</div>--> | ||
|
||
<!--<div>--> | ||
<!--<%= form.text_field :geometry_type %>--> | ||
<!--</div>--> | ||
|
||
<div> | ||
Выберете картинку | ||
</div> | ||
<div> | ||
<%= form.file_field :data %> | ||
</div> | ||
<div style="padding-top:20px;"> | ||
<%= submit_tag "Сохранить файл" %> | ||
</div> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<div style="padding-top:100px;padding-left:50px; padding-bottom:100px;"> | ||
<%= image_tag @inplace_image.data :original %> | ||
|
||
|
||
<div style="padding-top:100px;"> | ||
|
||
<% form_for @inplace_image, :inplace_image, :url=> crop_image_url(:id=>@inplace_image.id) do |form| %> | ||
<div> | ||
<%= form.error_messages %> | ||
</div> | ||
<div> | ||
ВВедите конфигурацию | ||
<input type="text" name="inplace_image[crop_geometry]" value="[100,100,80,80]"> | ||
</div> | ||
|
||
<div> | ||
sub_type_name - (например default) | ||
<input type="text" name="inplace_image[sub_type_name]" value=""> | ||
</div> | ||
|
||
|
||
<div style="padding-top:20px;"> | ||
<%= submit_tag "Кропить" %> | ||
</div> | ||
<% end %> | ||
|
||
</div> | ||
</div> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class CreateProducts < ActiveRecord::Migration | ||
def self.up | ||
create_table :products do |t| | ||
t.string :name | ||
t.text :description | ||
t.integer :inplace_image_id | ||
|
||
t.timestamps | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :products | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
name: MyString | ||
description: MyText | ||
inplace_image_id: 1 | ||
|
||
two: | ||
name: MyString | ||
description: MyText | ||
inplace_image_id: 1 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'test_helper' | ||
|
||
class ProductTest < ActiveSupport::TestCase | ||
# Replace this with your real tests. | ||
test "the truth" do | ||
assert true | ||
end | ||
end |