diff options
| author | Michel Etienne | 2016-01-08 10:15:46 +0100 |
|---|---|---|
| committer | Michel Etienne | 2016-01-08 10:15:46 +0100 |
| commit | c8dcd6bdbfad6b451f5ba1f9a48493703cac1ec2 (patch) | |
| tree | 9cb51562d44f7e020ea9c4e3875d9665aa523571 /app | |
| parent | fdbad5ea4742377230262ef29f5ae0ef15406a67 (diff) | |
| parent | 48b7e696ee4c273335889be3f68ad8f0a61ba8e9 (diff) | |
| download | chouette-core-c8dcd6bdbfad6b451f5ba1f9a48493703cac1ec2.tar.bz2 | |
Merge branch 'develop' of github.com:afimb/chouette2 into develop
Diffstat (limited to 'app')
| -rw-r--r-- | app/views/shared/_form_messages.html.erb | 7 | ||||
| -rw-r--r-- | app/views/vehicle_journeys/_form.html.erb | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/views/shared/_form_messages.html.erb b/app/views/shared/_form_messages.html.erb new file mode 100644 index 000000000..6eca2e69f --- /dev/null +++ b/app/views/shared/_form_messages.html.erb @@ -0,0 +1,7 @@ +<% if errors.any? %> + <% errors.full_messages.each do |message| %> + <div class="alert alert-danger" role="alert"> + <%= message %> + </div> + <% end %> +<% end %> diff --git a/app/views/vehicle_journeys/_form.html.erb b/app/views/vehicle_journeys/_form.html.erb index b7781d019..71f653b5c 100644 --- a/app/views/vehicle_journeys/_form.html.erb +++ b/app/views/vehicle_journeys/_form.html.erb @@ -1,4 +1,5 @@ <%= semantic_form_for vehicle_journey, url: form_url do |form| %> + <%= render 'shared/form_messages', { errors: vehicle_journey.errors } %> <%= form.inputs do %> <%= form.input :journey_pattern, :as => :select, :collection => @route.journey_patterns, :member_label => Proc.new { |jp| journey_name(jp) } %> <%= form.input :number %> @@ -20,7 +21,7 @@ <% end %> <%= form.actions do %> - <%= form.action :submit, as: :button, label: t(".submit_#{vehicle_journey.journey_category}#{'_edit' unless form.object.new_record?}") %> + <%= form.action :submit, as: :button, label: t(".submit_#{vehicle_journey.journey_category}#{'_edit' unless form.object.new_record?}"), button_html: { class: 'btn btn-primary' } %> <%= form.action :cancel, as: :link %> <% end %> <% end %> |
