forked from samuelgiles/papercrop
-
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
4434dfb
commit 36d0e87
Showing
13 changed files
with
81 additions
and
31 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 |
---|---|---|
|
@@ -9,3 +9,4 @@ test_app/Gemfile.lock | |
test_app/db/*.sqlite3 | ||
test_app/log/*.log | ||
test_app/tmp | ||
test_app/public/assets |
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
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
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
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
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
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
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
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,16 @@ | ||
<%= form_for(@landscape) do |f| %> | ||
|
||
<div class="landscape-crop-preview"> | ||
<% # Will show a preview box with width=100, height is calculated by the aspect ratio. see model Landscape %> | ||
<%= f.crop_preview :picture %> | ||
</div> | ||
<div class="landscape-crop-area"> | ||
<% # Crop area. Mantains original image proportions. Crop area takes the aspect ratio %> | ||
<%= f.cropbox :picture, :width => 600 %> | ||
</div> | ||
<div class="clear"></div> | ||
<div class="actions"> | ||
<%= f.submit 'Crop image' %> | ||
</div> | ||
<% 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 |
---|---|---|
@@ -1,16 +1 @@ | ||
<%= form_for(@landscape) do |f| %> | ||
|
||
<div class="landscape-crop-preview"> | ||
<% # Will show a preview box with width=100, height is calculated by the aspect ratio. see model Landscape %> | ||
<%= f.crop_preview :picture %> | ||
</div> | ||
<div class="landscape-crop-area"> | ||
<% # Crop area. Mantains original image proportions. Crop area takes the aspect ratio %> | ||
<%= f.cropbox :picture, :width => 600 %> | ||
</div> | ||
<div class="clear"></div> | ||
<div class="actions"> | ||
<%= f.submit 'Crop image' %> | ||
</div> | ||
<% end %> | ||
<%= render "crop_form" %> |
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 @@ | ||
$('body').html($('<%= escape_javascript(render("crop_form"))%>')); | ||
init_papercrop(); |
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
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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
TestApp::Application.routes.draw do | ||
resources :landscapes | ||
resources :landscapes do | ||
post 'crop', :on => :member | ||
end | ||
|
||
root :to => 'landscapes#index' | ||
end |