compony 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +1 -1
- data/VERSION +1 -1
- data/compony.gemspec +3 -3
- data/config/locales/de.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/config/locales/fr.yml +1 -1
- data/doc/ComponentGenerator.html +1 -1
- data/doc/Components.html +1 -1
- data/doc/ComponentsGenerator.html +1 -1
- data/doc/Compony/Component.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Labelling.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone/VerbDsl.html +1 -1
- data/doc/Compony/ComponentMixins/Default/Standalone.html +1 -1
- data/doc/Compony/ComponentMixins/Default.html +1 -1
- data/doc/Compony/ComponentMixins/Resourceful.html +1 -1
- data/doc/Compony/ComponentMixins.html +1 -1
- data/doc/Compony/Components/Button.html +1 -1
- data/doc/Compony/Components/Destroy.html +1 -1
- data/doc/Compony/Components/Edit.html +1 -1
- data/doc/Compony/Components/Form.html +1 -1
- data/doc/Compony/Components/Index.html +1 -1
- data/doc/Compony/Components/List.html +1 -1
- data/doc/Compony/Components/New.html +1 -1
- data/doc/Compony/Components/Show.html +1 -1
- data/doc/Compony/Components/WithForm.html +1 -1
- data/doc/Compony/Components.html +1 -1
- data/doc/Compony/ControllerMixin.html +1 -1
- data/doc/Compony/Engine.html +1 -1
- data/doc/Compony/MethodAccessibleHash.html +1 -1
- data/doc/Compony/ModelFields/Anchormodel.html +1 -1
- data/doc/Compony/ModelFields/Association.html +1 -1
- data/doc/Compony/ModelFields/Attachment.html +213 -19
- data/doc/Compony/ModelFields/Base.html +1 -1
- data/doc/Compony/ModelFields/Boolean.html +1 -1
- data/doc/Compony/ModelFields/Color.html +1 -1
- data/doc/Compony/ModelFields/Currency.html +1 -1
- data/doc/Compony/ModelFields/Date.html +1 -1
- data/doc/Compony/ModelFields/Datetime.html +1 -1
- data/doc/Compony/ModelFields/Decimal.html +1 -1
- data/doc/Compony/ModelFields/Email.html +1 -1
- data/doc/Compony/ModelFields/Float.html +1 -1
- data/doc/Compony/ModelFields/Integer.html +1 -1
- data/doc/Compony/ModelFields/Percentage.html +1 -1
- data/doc/Compony/ModelFields/Phone.html +1 -1
- data/doc/Compony/ModelFields/RichText.html +1 -1
- data/doc/Compony/ModelFields/String.html +1 -1
- data/doc/Compony/ModelFields/Text.html +1 -1
- data/doc/Compony/ModelFields/Time.html +1 -1
- data/doc/Compony/ModelFields/Url.html +1 -1
- data/doc/Compony/ModelFields.html +1 -1
- data/doc/Compony/ModelMixin.html +1 -1
- data/doc/Compony/NaturalOrdering.html +1 -1
- data/doc/Compony/RequestContext.html +1 -1
- data/doc/Compony/Version.html +1 -1
- data/doc/Compony/ViewHelpers.html +1 -1
- data/doc/Compony.html +1 -1
- data/doc/ComponyController.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +73 -57
- data/doc/top-level-namespace.html +1 -1
- data/lib/compony/model_fields/attachment.rb +47 -3
- metadata +2 -2
data/doc/method_list.html
CHANGED
@@ -757,6 +757,14 @@
|
|
757
757
|
|
758
758
|
|
759
759
|
<li class="even ">
|
760
|
+
<div class="item">
|
761
|
+
<span class='object_link'><a href="Compony/ModelFields/Attachment.html#initialize-instance_method" title="Compony::ModelFields::Attachment#initialize (method)">#initialize</a></span>
|
762
|
+
<small>Compony::ModelFields::Attachment</small>
|
763
|
+
</div>
|
764
|
+
</li>
|
765
|
+
|
766
|
+
|
767
|
+
<li class="odd ">
|
760
768
|
<div class="item">
|
761
769
|
<span class='object_link'><a href="Compony/ModelFields/Association.html#initialize-instance_method" title="Compony::ModelFields::Association#initialize (method)">#initialize</a></span>
|
762
770
|
<small>Compony::ModelFields::Association</small>
|
@@ -764,7 +772,7 @@
|
|
764
772
|
</li>
|
765
773
|
|
766
774
|
|
767
|
-
<li class="
|
775
|
+
<li class="even ">
|
768
776
|
<div class="item">
|
769
777
|
<span class='object_link'><a href="Compony/ComponentMixins/Resourceful.html#initialize-instance_method" title="Compony::ComponentMixins::Resourceful#initialize (method)">#initialize</a></span>
|
770
778
|
<small>Compony::ComponentMixins::Resourceful</small>
|
@@ -772,7 +780,7 @@
|
|
772
780
|
</li>
|
773
781
|
|
774
782
|
|
775
|
-
<li class="
|
783
|
+
<li class="odd ">
|
776
784
|
<div class="item">
|
777
785
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone/VerbDsl.html#initialize-instance_method" title="Compony::ComponentMixins::Default::Standalone::VerbDsl#initialize (method)">#initialize</a></span>
|
778
786
|
<small>Compony::ComponentMixins::Default::Standalone::VerbDsl</small>
|
@@ -780,7 +788,7 @@
|
|
780
788
|
</li>
|
781
789
|
|
782
790
|
|
783
|
-
<li class="
|
791
|
+
<li class="even ">
|
784
792
|
<div class="item">
|
785
793
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html#initialize-instance_method" title="Compony::ComponentMixins::Default::Standalone::StandaloneDsl#initialize (method)">#initialize</a></span>
|
786
794
|
<small>Compony::ComponentMixins::Default::Standalone::StandaloneDsl</small>
|
@@ -788,7 +796,7 @@
|
|
788
796
|
</li>
|
789
797
|
|
790
798
|
|
791
|
-
<li class="
|
799
|
+
<li class="odd ">
|
792
800
|
<div class="item">
|
793
801
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html#initialize-instance_method" title="Compony::ComponentMixins::Default::Standalone::ResourcefulVerbDsl#initialize (method)">#initialize</a></span>
|
794
802
|
<small>Compony::ComponentMixins::Default::Standalone::ResourcefulVerbDsl</small>
|
@@ -796,7 +804,7 @@
|
|
796
804
|
</li>
|
797
805
|
|
798
806
|
|
799
|
-
<li class="
|
807
|
+
<li class="even ">
|
800
808
|
<div class="item">
|
801
809
|
<span class='object_link'><a href="Compony/Component.html#inspect-instance_method" title="Compony::Component#inspect (method)">#inspect</a></span>
|
802
810
|
<small>Compony::Component</small>
|
@@ -804,7 +812,7 @@
|
|
804
812
|
</li>
|
805
813
|
|
806
814
|
|
807
|
-
<li class="
|
815
|
+
<li class="odd ">
|
808
816
|
<div class="item">
|
809
817
|
<span class='object_link'><a href="Compony/ModelFields/Base.html#label-instance_method" title="Compony::ModelFields::Base#label (method)">#label</a></span>
|
810
818
|
<small>Compony::ModelFields::Base</small>
|
@@ -812,7 +820,7 @@
|
|
812
820
|
</li>
|
813
821
|
|
814
822
|
|
815
|
-
<li class="
|
823
|
+
<li class="even ">
|
816
824
|
<div class="item">
|
817
825
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Labelling.html#label-instance_method" title="Compony::ComponentMixins::Default::Labelling#label (method)">#label</a></span>
|
818
826
|
<small>Compony::ComponentMixins::Default::Labelling</small>
|
@@ -820,7 +828,7 @@
|
|
820
828
|
</li>
|
821
829
|
|
822
830
|
|
823
|
-
<li class="
|
831
|
+
<li class="odd ">
|
824
832
|
<div class="item">
|
825
833
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone/StandaloneDsl.html#layout-instance_method" title="Compony::ComponentMixins::Default::Standalone::StandaloneDsl#layout (method)">#layout</a></span>
|
826
834
|
<small>Compony::ComponentMixins::Default::Standalone::StandaloneDsl</small>
|
@@ -828,7 +836,7 @@
|
|
828
836
|
</li>
|
829
837
|
|
830
838
|
|
831
|
-
<li class="
|
839
|
+
<li class="even ">
|
832
840
|
<div class="item">
|
833
841
|
<span class='object_link'><a href="Compony/ComponentMixins/Resourceful.html#load_data-instance_method" title="Compony::ComponentMixins::Resourceful#load_data (method)">#load_data</a></span>
|
834
842
|
<small>Compony::ComponentMixins::Resourceful</small>
|
@@ -836,7 +844,7 @@
|
|
836
844
|
</li>
|
837
845
|
|
838
846
|
|
839
|
-
<li class="
|
847
|
+
<li class="odd ">
|
840
848
|
<div class="item">
|
841
849
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone/ResourcefulVerbDsl.html#load_data-instance_method" title="Compony::ComponentMixins::Default::Standalone::ResourcefulVerbDsl#load_data (method)">#load_data</a></span>
|
842
850
|
<small>Compony::ComponentMixins::Default::Standalone::ResourcefulVerbDsl</small>
|
@@ -844,7 +852,7 @@
|
|
844
852
|
</li>
|
845
853
|
|
846
854
|
|
847
|
-
<li class="
|
855
|
+
<li class="even ">
|
848
856
|
<div class="item">
|
849
857
|
<span class='object_link'><a href="Compony/RequestContext.html#local_assigns-instance_method" title="Compony::RequestContext#local_assigns (method)">#local_assigns</a></span>
|
850
858
|
<small>Compony::RequestContext</small>
|
@@ -852,7 +860,7 @@
|
|
852
860
|
</li>
|
853
861
|
|
854
862
|
|
855
|
-
<li class="
|
863
|
+
<li class="odd ">
|
856
864
|
<div class="item">
|
857
865
|
<span class='object_link'><a href="Compony/MethodAccessibleHash.html#merge-instance_method" title="Compony::MethodAccessibleHash#merge (method)">#merge</a></span>
|
858
866
|
<small>Compony::MethodAccessibleHash</small>
|
@@ -860,7 +868,7 @@
|
|
860
868
|
</li>
|
861
869
|
|
862
870
|
|
863
|
-
<li class="
|
871
|
+
<li class="even ">
|
864
872
|
<div class="item">
|
865
873
|
<span class='object_link'><a href="Compony/RequestContext.html#method_missing-instance_method" title="Compony::RequestContext#method_missing (method)">#method_missing</a></span>
|
866
874
|
<small>Compony::RequestContext</small>
|
@@ -868,7 +876,7 @@
|
|
868
876
|
</li>
|
869
877
|
|
870
878
|
|
871
|
-
<li class="
|
879
|
+
<li class="odd ">
|
872
880
|
<div class="item">
|
873
881
|
<span class='object_link'><a href="Compony/MethodAccessibleHash.html#method_missing-instance_method" title="Compony::MethodAccessibleHash#method_missing (method)">#method_missing</a></span>
|
874
882
|
<small>Compony::MethodAccessibleHash</small>
|
@@ -876,7 +884,7 @@
|
|
876
884
|
</li>
|
877
885
|
|
878
886
|
|
879
|
-
<li class="
|
887
|
+
<li class="even ">
|
880
888
|
<div class="item">
|
881
889
|
<span class='object_link'><a href="Compony/ModelFields/Base.html#model_class-instance_method" title="Compony::ModelFields::Base#model_class (method)">#model_class</a></span>
|
882
890
|
<small>Compony::ModelFields::Base</small>
|
@@ -884,7 +892,7 @@
|
|
884
892
|
</li>
|
885
893
|
|
886
894
|
|
887
|
-
<li class="
|
895
|
+
<li class="odd ">
|
888
896
|
<div class="item">
|
889
897
|
<span class='object_link'><a href="Compony.html#model_field_class_for-class_method" title="Compony.model_field_class_for (method)">model_field_class_for</a></span>
|
890
898
|
<small>Compony</small>
|
@@ -892,7 +900,7 @@
|
|
892
900
|
</li>
|
893
901
|
|
894
902
|
|
895
|
-
<li class="
|
903
|
+
<li class="even ">
|
896
904
|
<div class="item">
|
897
905
|
<span class='object_link'><a href="Compony.html#model_field_namespaces-class_method" title="Compony.model_field_namespaces (method)">model_field_namespaces</a></span>
|
898
906
|
<small>Compony</small>
|
@@ -900,7 +908,7 @@
|
|
900
908
|
</li>
|
901
909
|
|
902
910
|
|
903
|
-
<li class="
|
911
|
+
<li class="odd ">
|
904
912
|
<div class="item">
|
905
913
|
<span class='object_link'><a href="Compony.html#model_field_namespaces=-class_method" title="Compony.model_field_namespaces= (method)">model_field_namespaces=</a></span>
|
906
914
|
<small>Compony</small>
|
@@ -908,7 +916,7 @@
|
|
908
916
|
</li>
|
909
917
|
|
910
918
|
|
911
|
-
<li class="
|
919
|
+
<li class="even ">
|
912
920
|
<div class="item">
|
913
921
|
<span class='object_link'><a href="Compony/ModelFields/Base.html#multi%3F-instance_method" title="Compony::ModelFields::Base#multi? (method)">#multi?</a></span>
|
914
922
|
<small>Compony::ModelFields::Base</small>
|
@@ -916,7 +924,7 @@
|
|
916
924
|
</li>
|
917
925
|
|
918
926
|
|
919
|
-
<li class="
|
927
|
+
<li class="odd ">
|
920
928
|
<div class="item">
|
921
929
|
<span class='object_link'><a href="Compony/ModelFields/Base.html#name-instance_method" title="Compony::ModelFields::Base#name (method)">#name</a></span>
|
922
930
|
<small>Compony::ModelFields::Base</small>
|
@@ -924,7 +932,7 @@
|
|
924
932
|
</li>
|
925
933
|
|
926
934
|
|
927
|
-
<li class="
|
935
|
+
<li class="even ">
|
928
936
|
<div class="item">
|
929
937
|
<span class='object_link'><a href="Compony/NaturalOrdering.html#natural_push-instance_method" title="Compony::NaturalOrdering#natural_push (method)">#natural_push</a></span>
|
930
938
|
<small>Compony::NaturalOrdering</small>
|
@@ -932,7 +940,7 @@
|
|
932
940
|
</li>
|
933
941
|
|
934
942
|
|
935
|
-
<li class="
|
943
|
+
<li class="odd ">
|
936
944
|
<div class="item">
|
937
945
|
<span class='object_link'><a href="Compony/Components/New.html#on_create_failed_respond-instance_method" title="Compony::Components::New#on_create_failed_respond (method)">#on_create_failed_respond</a></span>
|
938
946
|
<small>Compony::Components::New</small>
|
@@ -940,7 +948,7 @@
|
|
940
948
|
</li>
|
941
949
|
|
942
950
|
|
943
|
-
<li class="
|
951
|
+
<li class="even ">
|
944
952
|
<div class="item">
|
945
953
|
<span class='object_link'><a href="Compony/Components/New.html#on_created-instance_method" title="Compony::Components::New#on_created (method)">#on_created</a></span>
|
946
954
|
<small>Compony::Components::New</small>
|
@@ -948,7 +956,7 @@
|
|
948
956
|
</li>
|
949
957
|
|
950
958
|
|
951
|
-
<li class="
|
959
|
+
<li class="odd ">
|
952
960
|
<div class="item">
|
953
961
|
<span class='object_link'><a href="Compony/Components/New.html#on_created_redirect_path-instance_method" title="Compony::Components::New#on_created_redirect_path (method)">#on_created_redirect_path</a></span>
|
954
962
|
<small>Compony::Components::New</small>
|
@@ -956,7 +964,7 @@
|
|
956
964
|
</li>
|
957
965
|
|
958
966
|
|
959
|
-
<li class="
|
967
|
+
<li class="even ">
|
960
968
|
<div class="item">
|
961
969
|
<span class='object_link'><a href="Compony/Components/New.html#on_created_respond-instance_method" title="Compony::Components::New#on_created_respond (method)">#on_created_respond</a></span>
|
962
970
|
<small>Compony::Components::New</small>
|
@@ -964,7 +972,7 @@
|
|
964
972
|
</li>
|
965
973
|
|
966
974
|
|
967
|
-
<li class="
|
975
|
+
<li class="odd ">
|
968
976
|
<div class="item">
|
969
977
|
<span class='object_link'><a href="Compony/Components/Destroy.html#on_destroyed-instance_method" title="Compony::Components::Destroy#on_destroyed (method)">#on_destroyed</a></span>
|
970
978
|
<small>Compony::Components::Destroy</small>
|
@@ -972,7 +980,7 @@
|
|
972
980
|
</li>
|
973
981
|
|
974
982
|
|
975
|
-
<li class="
|
983
|
+
<li class="even ">
|
976
984
|
<div class="item">
|
977
985
|
<span class='object_link'><a href="Compony/Components/Destroy.html#on_destroyed_redirect_path-instance_method" title="Compony::Components::Destroy#on_destroyed_redirect_path (method)">#on_destroyed_redirect_path</a></span>
|
978
986
|
<small>Compony::Components::Destroy</small>
|
@@ -980,7 +988,7 @@
|
|
980
988
|
</li>
|
981
989
|
|
982
990
|
|
983
|
-
<li class="
|
991
|
+
<li class="odd ">
|
984
992
|
<div class="item">
|
985
993
|
<span class='object_link'><a href="Compony/Components/Destroy.html#on_destroyed_respond-instance_method" title="Compony::Components::Destroy#on_destroyed_respond (method)">#on_destroyed_respond</a></span>
|
986
994
|
<small>Compony::Components::Destroy</small>
|
@@ -988,7 +996,7 @@
|
|
988
996
|
</li>
|
989
997
|
|
990
998
|
|
991
|
-
<li class="
|
999
|
+
<li class="even ">
|
992
1000
|
<div class="item">
|
993
1001
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone.html#on_standalone_access-instance_method" title="Compony::ComponentMixins::Default::Standalone#on_standalone_access (method)">#on_standalone_access</a></span>
|
994
1002
|
<small>Compony::ComponentMixins::Default::Standalone</small>
|
@@ -996,7 +1004,7 @@
|
|
996
1004
|
</li>
|
997
1005
|
|
998
1006
|
|
999
|
-
<li class="
|
1007
|
+
<li class="odd ">
|
1000
1008
|
<div class="item">
|
1001
1009
|
<span class='object_link'><a href="Compony/Components/Edit.html#on_update_failed-instance_method" title="Compony::Components::Edit#on_update_failed (method)">#on_update_failed</a></span>
|
1002
1010
|
<small>Compony::Components::Edit</small>
|
@@ -1004,7 +1012,7 @@
|
|
1004
1012
|
</li>
|
1005
1013
|
|
1006
1014
|
|
1007
|
-
<li class="
|
1015
|
+
<li class="even ">
|
1008
1016
|
<div class="item">
|
1009
1017
|
<span class='object_link'><a href="Compony/Components/Edit.html#on_updated-instance_method" title="Compony::Components::Edit#on_updated (method)">#on_updated</a></span>
|
1010
1018
|
<small>Compony::Components::Edit</small>
|
@@ -1012,7 +1020,7 @@
|
|
1012
1020
|
</li>
|
1013
1021
|
|
1014
1022
|
|
1015
|
-
<li class="
|
1023
|
+
<li class="odd ">
|
1016
1024
|
<div class="item">
|
1017
1025
|
<span class='object_link'><a href="Compony/Components/Edit.html#on_updated_redirect_path-instance_method" title="Compony::Components::Edit#on_updated_redirect_path (method)">#on_updated_redirect_path</a></span>
|
1018
1026
|
<small>Compony::Components::Edit</small>
|
@@ -1020,7 +1028,7 @@
|
|
1020
1028
|
</li>
|
1021
1029
|
|
1022
1030
|
|
1023
|
-
<li class="
|
1031
|
+
<li class="even ">
|
1024
1032
|
<div class="item">
|
1025
1033
|
<span class='object_link'><a href="Compony/Components/Edit.html#on_updated_respond-instance_method" title="Compony::Components::Edit#on_updated_respond (method)">#on_updated_respond</a></span>
|
1026
1034
|
<small>Compony::Components::Edit</small>
|
@@ -1028,7 +1036,7 @@
|
|
1028
1036
|
</li>
|
1029
1037
|
|
1030
1038
|
|
1031
|
-
<li class="
|
1039
|
+
<li class="odd ">
|
1032
1040
|
<div class="item">
|
1033
1041
|
<span class='object_link'><a href="Compony/Components/List.html#pagination_enabled%3F-instance_method" title="Compony::Components::List#pagination_enabled? (method)">#pagination_enabled?</a></span>
|
1034
1042
|
<small>Compony::Components::List</small>
|
@@ -1036,7 +1044,7 @@
|
|
1036
1044
|
</li>
|
1037
1045
|
|
1038
1046
|
|
1039
|
-
<li class="
|
1047
|
+
<li class="even ">
|
1040
1048
|
<div class="item">
|
1041
1049
|
<span class='object_link'><a href="Compony/Component.html#param_name-instance_method" title="Compony::Component#param_name (method)">#param_name</a></span>
|
1042
1050
|
<small>Compony::Component</small>
|
@@ -1044,7 +1052,7 @@
|
|
1044
1052
|
</li>
|
1045
1053
|
|
1046
1054
|
|
1047
|
-
<li class="
|
1055
|
+
<li class="odd ">
|
1048
1056
|
<div class="item">
|
1049
1057
|
<span class='object_link'><a href="Compony/Component.html#parent_comp-instance_method" title="Compony::Component#parent_comp (method)">#parent_comp</a></span>
|
1050
1058
|
<small>Compony::Component</small>
|
@@ -1052,7 +1060,7 @@
|
|
1052
1060
|
</li>
|
1053
1061
|
|
1054
1062
|
|
1055
|
-
<li class="
|
1063
|
+
<li class="even ">
|
1056
1064
|
<div class="item">
|
1057
1065
|
<span class='object_link'><a href="Compony.html#path-class_method" title="Compony.path (method)">path</a></span>
|
1058
1066
|
<small>Compony</small>
|
@@ -1060,7 +1068,7 @@
|
|
1060
1068
|
</li>
|
1061
1069
|
|
1062
1070
|
|
1063
|
-
<li class="
|
1071
|
+
<li class="odd ">
|
1064
1072
|
<div class="item">
|
1065
1073
|
<span class='object_link'><a href="Compony/Component.html#path-instance_method" title="Compony::Component#path (method)">#path</a></span>
|
1066
1074
|
<small>Compony::Component</small>
|
@@ -1068,7 +1076,7 @@
|
|
1068
1076
|
</li>
|
1069
1077
|
|
1070
1078
|
|
1071
|
-
<li class="
|
1079
|
+
<li class="even ">
|
1072
1080
|
<div class="item">
|
1073
1081
|
<span class='object_link'><a href="Compony/Component.html#path_hash-instance_method" title="Compony::Component#path_hash (method)">#path_hash</a></span>
|
1074
1082
|
<small>Compony::Component</small>
|
@@ -1076,7 +1084,7 @@
|
|
1076
1084
|
</li>
|
1077
1085
|
|
1078
1086
|
|
1079
|
-
<li class="
|
1087
|
+
<li class="odd ">
|
1080
1088
|
<div class="item">
|
1081
1089
|
<span class='object_link'><a href="Compony.html#path_helper_name-class_method" title="Compony.path_helper_name (method)">path_helper_name</a></span>
|
1082
1090
|
<small>Compony</small>
|
@@ -1084,7 +1092,7 @@
|
|
1084
1092
|
</li>
|
1085
1093
|
|
1086
1094
|
|
1087
|
-
<li class="
|
1095
|
+
<li class="even ">
|
1088
1096
|
<div class="item">
|
1089
1097
|
<span class='object_link'><a href="Compony/Components/List.html#process_data!-instance_method" title="Compony::Components::List#process_data! (method)">#process_data!</a></span>
|
1090
1098
|
<small>Compony::Components::List</small>
|
@@ -1092,7 +1100,7 @@
|
|
1092
1100
|
</li>
|
1093
1101
|
|
1094
1102
|
|
1095
|
-
<li class="
|
1103
|
+
<li class="odd ">
|
1096
1104
|
<div class="item">
|
1097
1105
|
<span class='object_link'><a href="Compony/Components/Form.html#pw_field-instance_method" title="Compony::Components::Form#pw_field (method)">#pw_field</a></span>
|
1098
1106
|
<small>Compony::Components::Form</small>
|
@@ -1100,7 +1108,7 @@
|
|
1100
1108
|
</li>
|
1101
1109
|
|
1102
1110
|
|
1103
|
-
<li class="
|
1111
|
+
<li class="even ">
|
1104
1112
|
<div class="item">
|
1105
1113
|
<span class='object_link'><a href="Compony.html#rails_action_name-class_method" title="Compony.rails_action_name (method)">rails_action_name</a></span>
|
1106
1114
|
<small>Compony</small>
|
@@ -1108,7 +1116,7 @@
|
|
1108
1116
|
</li>
|
1109
1117
|
|
1110
1118
|
|
1111
|
-
<li class="
|
1119
|
+
<li class="odd ">
|
1112
1120
|
<div class="item">
|
1113
1121
|
<span class='object_link'><a href="Compony/ModelFields/Base.html#ransack_filter_input-instance_method" title="Compony::ModelFields::Base#ransack_filter_input (method)">#ransack_filter_input</a></span>
|
1114
1122
|
<small>Compony::ModelFields::Base</small>
|
@@ -1116,7 +1124,7 @@
|
|
1116
1124
|
</li>
|
1117
1125
|
|
1118
1126
|
|
1119
|
-
<li class="
|
1127
|
+
<li class="even ">
|
1120
1128
|
<div class="item">
|
1121
1129
|
<span class='object_link'><a href="Compony/ModelFields/Boolean.html#ransack_filter_input-instance_method" title="Compony::ModelFields::Boolean#ransack_filter_input (method)">#ransack_filter_input</a></span>
|
1122
1130
|
<small>Compony::ModelFields::Boolean</small>
|
@@ -1124,7 +1132,7 @@
|
|
1124
1132
|
</li>
|
1125
1133
|
|
1126
1134
|
|
1127
|
-
<li class="
|
1135
|
+
<li class="odd ">
|
1128
1136
|
<div class="item">
|
1129
1137
|
<span class='object_link'><a href="Compony/ModelFields/Anchormodel.html#ransack_filter_input-instance_method" title="Compony::ModelFields::Anchormodel#ransack_filter_input (method)">#ransack_filter_input</a></span>
|
1130
1138
|
<small>Compony::ModelFields::Anchormodel</small>
|
@@ -1132,7 +1140,7 @@
|
|
1132
1140
|
</li>
|
1133
1141
|
|
1134
1142
|
|
1135
|
-
<li class="
|
1143
|
+
<li class="even ">
|
1136
1144
|
<div class="item">
|
1137
1145
|
<span class='object_link'><a href="Compony/ModelFields/Base.html#ransack_filter_name-instance_method" title="Compony::ModelFields::Base#ransack_filter_name (method)">#ransack_filter_name</a></span>
|
1138
1146
|
<small>Compony::ModelFields::Base</small>
|
@@ -1140,7 +1148,7 @@
|
|
1140
1148
|
</li>
|
1141
1149
|
|
1142
1150
|
|
1143
|
-
<li class="
|
1151
|
+
<li class="odd ">
|
1144
1152
|
<div class="item">
|
1145
1153
|
<span class='object_link'><a href="Compony/ModelFields/Boolean.html#ransack_filter_name-instance_method" title="Compony::ModelFields::Boolean#ransack_filter_name (method)">#ransack_filter_name</a></span>
|
1146
1154
|
<small>Compony::ModelFields::Boolean</small>
|
@@ -1148,7 +1156,7 @@
|
|
1148
1156
|
</li>
|
1149
1157
|
|
1150
1158
|
|
1151
|
-
<li class="
|
1159
|
+
<li class="even ">
|
1152
1160
|
<div class="item">
|
1153
1161
|
<span class='object_link'><a href="Compony/ModelFields/Integer.html#ransack_filter_name-instance_method" title="Compony::ModelFields::Integer#ransack_filter_name (method)">#ransack_filter_name</a></span>
|
1154
1162
|
<small>Compony::ModelFields::Integer</small>
|
@@ -1156,7 +1164,7 @@
|
|
1156
1164
|
</li>
|
1157
1165
|
|
1158
1166
|
|
1159
|
-
<li class="
|
1167
|
+
<li class="odd ">
|
1160
1168
|
<div class="item">
|
1161
1169
|
<span class='object_link'><a href="Compony/ModelFields/Anchormodel.html#ransack_filter_name-instance_method" title="Compony::ModelFields::Anchormodel#ransack_filter_name (method)">#ransack_filter_name</a></span>
|
1162
1170
|
<small>Compony::ModelFields::Anchormodel</small>
|
@@ -1164,7 +1172,7 @@
|
|
1164
1172
|
</li>
|
1165
1173
|
|
1166
1174
|
|
1167
|
-
<li class="
|
1175
|
+
<li class="even ">
|
1168
1176
|
<div class="item">
|
1169
1177
|
<span class='object_link'><a href="Compony/Component.html#remove_content-instance_method" title="Compony::Component#remove_content (method)">#remove_content</a></span>
|
1170
1178
|
<small>Compony::Component</small>
|
@@ -1172,7 +1180,7 @@
|
|
1172
1180
|
</li>
|
1173
1181
|
|
1174
1182
|
|
1175
|
-
<li class="
|
1183
|
+
<li class="odd ">
|
1176
1184
|
<div class="item">
|
1177
1185
|
<span class='object_link'><a href="Compony/Component.html#remove_content!-instance_method" title="Compony::Component#remove_content! (method)">#remove_content!</a></span>
|
1178
1186
|
<small>Compony::Component</small>
|
@@ -1180,7 +1188,7 @@
|
|
1180
1188
|
</li>
|
1181
1189
|
|
1182
1190
|
|
1183
|
-
<li class="
|
1191
|
+
<li class="even ">
|
1184
1192
|
<div class="item">
|
1185
1193
|
<span class='object_link'><a href="Compony/Component.html#render-instance_method" title="Compony::Component#render (method)">#render</a></span>
|
1186
1194
|
<small>Compony::Component</small>
|
@@ -1188,7 +1196,7 @@
|
|
1188
1196
|
</li>
|
1189
1197
|
|
1190
1198
|
|
1191
|
-
<li class="
|
1199
|
+
<li class="odd ">
|
1192
1200
|
<div class="item">
|
1193
1201
|
<span class='object_link'><a href="Compony/Component.html#render_actions-instance_method" title="Compony::Component#render_actions (method)">#render_actions</a></span>
|
1194
1202
|
<small>Compony::Component</small>
|
@@ -1196,7 +1204,7 @@
|
|
1196
1204
|
</li>
|
1197
1205
|
|
1198
1206
|
|
1199
|
-
<li class="
|
1207
|
+
<li class="even ">
|
1200
1208
|
<div class="item">
|
1201
1209
|
<span class='object_link'><a href="Compony/ComponentMixins/Default/Standalone.html#render_standalone-instance_method" title="Compony::ComponentMixins::Default::Standalone#render_standalone (method)">#render_standalone</a></span>
|
1202
1210
|
<small>Compony::ComponentMixins::Default::Standalone</small>
|
@@ -1204,7 +1212,7 @@
|
|
1204
1212
|
</li>
|
1205
1213
|
|
1206
1214
|
|
1207
|
-
<li class="
|
1215
|
+
<li class="odd ">
|
1208
1216
|
<div class="item">
|
1209
1217
|
<span class='object_link'><a href="Compony/RequestContext.html#request_context-instance_method" title="Compony::RequestContext#request_context (method)">#request_context</a></span>
|
1210
1218
|
<small>Compony::RequestContext</small>
|
@@ -1212,7 +1220,7 @@
|
|
1212
1220
|
</li>
|
1213
1221
|
|
1214
1222
|
|
1215
|
-
<li class="
|
1223
|
+
<li class="even ">
|
1216
1224
|
<div class="item">
|
1217
1225
|
<span class='object_link'><a href="Compony/ModelFields/Association.html#resolve_association!-instance_method" title="Compony::ModelFields::Association#resolve_association! (method)">#resolve_association!</a></span>
|
1218
1226
|
<small>Compony::ModelFields::Association</small>
|
@@ -1220,6 +1228,14 @@
|
|
1220
1228
|
</li>
|
1221
1229
|
|
1222
1230
|
|
1231
|
+
<li class="odd ">
|
1232
|
+
<div class="item">
|
1233
|
+
<span class='object_link'><a href="Compony/ModelFields/Attachment.html#resolve_attachment!-instance_method" title="Compony::ModelFields::Attachment#resolve_attachment! (method)">#resolve_attachment!</a></span>
|
1234
|
+
<small>Compony::ModelFields::Attachment</small>
|
1235
|
+
</div>
|
1236
|
+
</li>
|
1237
|
+
|
1238
|
+
|
1223
1239
|
<li class="even ">
|
1224
1240
|
<div class="item">
|
1225
1241
|
<span class='object_link'><a href="Compony/Component.html#resourceful%3F-instance_method" title="Compony::Component#resourceful? (method)">#resourceful?</a></span>
|
@@ -102,7 +102,7 @@
|
|
102
102
|
</div>
|
103
103
|
|
104
104
|
<div id="footer">
|
105
|
-
Generated on
|
105
|
+
Generated on Thu Sep 25 13:03:51 2025 by
|
106
106
|
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
107
107
|
0.9.34 (ruby-3.3.5).
|
108
108
|
</div>
|
@@ -3,17 +3,61 @@ module Compony
|
|
3
3
|
# @api description
|
4
4
|
# Model field type representing an ActiveStorage attachment.
|
5
5
|
class Attachment < Base
|
6
|
+
def initialize(...)
|
7
|
+
super
|
8
|
+
resolve_attachment!
|
9
|
+
end
|
10
|
+
|
6
11
|
def value_for(data, controller: nil, **_)
|
7
12
|
return transform_and_join(data.send(@name), controller:) do |el|
|
8
13
|
fail('Must pass controller to generate the link to the attachment.') unless controller
|
9
|
-
|
10
|
-
|
14
|
+
if @multi
|
15
|
+
return nil if el.none?
|
16
|
+
return controller.helpers.safe_join(el.map { |item| controller.helpers.link_to(item.filename, controller.helpers.rails_blob_path(item)) }, ', ')
|
17
|
+
else
|
18
|
+
return nil unless el.attached?
|
19
|
+
return controller.helpers.link_to(el.filename, controller.helpers.rails_blob_path(el))
|
20
|
+
end
|
11
21
|
end
|
12
22
|
end
|
13
23
|
|
14
24
|
def simpleform_input(form, _component, name: nil, accept: nil, **input_opts)
|
25
|
+
name ||= @name
|
15
26
|
input_opts.deep_merge!(input_html: { accept: }) if accept
|
16
|
-
|
27
|
+
if @multi
|
28
|
+
if form.object.new_record?
|
29
|
+
# signed id is only calculated when the attachment is actually attached, cannot provide buttons for new records
|
30
|
+
return form.input(name, **input_opts.deep_merge(input_html: { multiple: :multiple }))
|
31
|
+
else
|
32
|
+
helpers = ActionController::Base.helpers
|
33
|
+
return helpers.capture do
|
34
|
+
helpers.concat form.label(name)
|
35
|
+
# List currently present attachments along with a remove button (done in JS)
|
36
|
+
helpers.div class: 'compony-attachments-item-wrapper' do
|
37
|
+
form.object.send(name).each do |attachment|
|
38
|
+
helpers.div class: 'compony-attachments-item' do
|
39
|
+
helpers.concat helpers.hidden_field_tag("#{form.object.model_name.singular}[#{name}][]", attachment.signed_id)
|
40
|
+
helpers.span attachment.filename, class: 'compony-attachments-filename'
|
41
|
+
helpers.span ' ', class: 'compony-attachments-spacer'
|
42
|
+
helpers.concat helpers.link_to(I18n.t('compony.model_fields.attachment.remove'), '#',
|
43
|
+
onclick: "event.preventDefault(); this.closest('div').remove();")
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
helpers.concat form.input(name, **input_opts.deep_merge(input_html: { multiple: :multiple }, label: false, class: 'compony-attachments-input'))
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
return form.input(name, **input_opts)
|
52
|
+
end
|
53
|
+
|
54
|
+
protected
|
55
|
+
|
56
|
+
# Uses Rails method to figure out arity and store it.
|
57
|
+
# This can be auto-inferred without accessing the database.
|
58
|
+
def resolve_attachment!
|
59
|
+
attachment_info = model_class.reflect_on_attachment(name)
|
60
|
+
@multi = attachment_info.is_a?(ActiveStorage::Reflection::HasManyAttachedReflection)
|
17
61
|
end
|
18
62
|
end
|
19
63
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sandro Kalbermatter
|
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
335
|
- !ruby/object:Gem::Version
|
336
336
|
version: '0'
|
337
337
|
requirements: []
|
338
|
-
rubygems_version: 3.
|
338
|
+
rubygems_version: 3.7.1
|
339
339
|
specification_version: 4
|
340
340
|
summary: Compony is a Gem that allows you to write your Rails application in component-style
|
341
341
|
fashion. It combines a controller action and route along \ with its view into a
|