diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index 4435ec6..566aa4b 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -56,9 +56,11 @@ class ThemenController < ApplicationController if @thema.save format.html { redirect_to @thema, notice: 'Thema was successfully created.' } format.json { render json: @thema, status: :created, location: @thema } + format.js {render action: "update"} else format.html { render action: "new" } format.json { render json: @thema.errors, status: :unprocessable_entity } + format.js { render action: "edit" } end end end diff --git a/app/views/themen/new.html.erb b/app/views/themen/new.html.erb index 5a0ff02..d2d719c 100644 --- a/app/views/themen/new.html.erb +++ b/app/views/themen/new.html.erb @@ -1,5 +1,6 @@ -

New thema

+
+

<%= I18n.t("thema.add") %>

<%= render 'form' %> - +
<%= link_to 'Back', themen_path %> diff --git a/config/locales/de.yml b/config/locales/de.yml index 3005cde..0f0ae05 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -24,6 +24,7 @@ de: mitarbeiter: "Mitarbeiter" fotos: "Fotos" search: "Suche" + formtastic: titles: modul: diff --git a/config/locales/themen.de.yml b/config/locales/themen.de.yml index 3b0229b..1df9261 100644 --- a/config/locales/themen.de.yml +++ b/config/locales/themen.de.yml @@ -18,4 +18,19 @@ de: sure: "Sicher, dass Sie diese Frage löschen möchten?" attachment: title: "Anhang" - add: "Anhang hinzufügen" \ No newline at end of file + add: "Anhang hinzufügen" + formtastic: + labels: + thema: + title: "Themen Name" + themengruppe: "Gruppe" + hints: + thema: + title: "Überschrift" + activerecord: + errors: + models: + thema: + attributes: + title: + blank: "Der Themen Name darf nicht leer sein!"