-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request headers #8
Changes from 1 commit
36e8801
819181b
39d3a76
a759aca
d4dbea8
3b0e0c6
474eefa
2ff2b43
6d45f6c
2011e4e
86e0462
b647917
a002d71
838ab4b
4a1ba3f
0832022
02a7e11
c549c91
bf1b975
7341484
21afc3b
eb72a6c
7b33bc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<%= JsRoutes.generate(default_url_options: { :host => ENV['APP_DOMAIN'] }, url_links: true, exclude: [/admin/] ) %> | ||
<%= JsRoutes.generate(default_url_options: { :host => 'localhost:3000' }, url_links: true, exclude: [/admin/] ) %> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,16 @@ def index | |
end | ||
|
||
def create | ||
@subscriber = Subscriber.where("email = ? and website_id = ?", params['email'], @current_site.id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aici schimba @current_site cu current_site. Pentru ca facem schimbarea de mai sus. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. poti sa schimbi de fapt toata linia cu There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nu mai folosi |
||
@error = Issue.where("description = ?", params['message']) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. asta nu prea are sens. description ala cel mai probabil o sa fie un backtrace sau un mesaj pe care il trimite siteu cu eroarea. Ti-am zis ca params['message'] asta nu prea are loc in momentul asta. Ce putem sa facem e sa adaugam un nou tabel cu mesajele. Si sa fie mesajele legate de issue_id si subscriber_id |
||
if @subscriber.blank? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aici probabil ca trebuie sa schimbi doar cu |
||
@subscriber = Subscriber.create( email: params['email'], name: params['email'], created_at: Time.now, updated_at: Time.now, website_id: @current_site.id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wtf nu e nevoie sa setezi created_at si updated_at alea sunt salvate automat ..... Daca avem current_site foloseste |
||
end | ||
|
||
if @error.blank? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
@error = Issue.create(description: params['message'], created_at: Time.now, updated_at: Time.now, status: 1, website_id: @current_site.id) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. description ca si mai sus nu isi are locul aici. ce trebuie sa salvezi e restul de informatii. foloseste |
||
SubscriberIssue.create(subscriber_id: @subscriber.id, issue_id: @error.id,created_at: Time.now, updated_at: Time.now) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
end | ||
end | ||
|
||
def show | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class AddAppIdAndAppKeyToWebsites < ActiveRecord::Migration | ||
def change | ||
add_column :websites, :app_id, :integer | ||
add_column :websites, :app_key, :string | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hai sa facem aici altfel. Hai sa combinam in metoda asta current_site cu metoda aia set_websites_from_header. Fai aici asa:
In felu asta nu avem nevoie de before_filter deasupra si nici de metoda aia de am facut-o acum