angular 2 subscription class not found | Fixed issues |
- angular 2 subscription class not found
- String start with # return with backslash in rails console in some case
- Rails 4 Spree Invoke callback "Undefined method for User xxxxx"
- Javascript browser console error 404 (Not Found)
- Create marker on mapbox with rails
- Grant permission for the path
- Ruby on Rails with React getting NoMethodError
- How to update a web page from requests made by another client (in rails)?
- How do I set up the Elasticsearch indices for this Rails 3.2 project I've inherited?
- Tracking with google analytics sign up page in Rails with Devise
- Rails 4: How do I delete a nested object?
- How can I Iterate through items and generate drag and drop buttons for each one?
- Ruby on rails select tags from fixed lists(rails)
- How to reverse an irreversible migration
- Rails - validation inside decorator
- Unable to load Bootstrap.min file
- Ruby Active Record accessor dot(.) vs bracket([])
- ignore Rack::Timeout middle in specific rails routes
- How to achieve sequential processing in Rails?
- Froala, Amazon S3, CORS, Error Message: No 'Access-Control-Allow-Origin' header is present on the requested resource
- How to get data which falls on specific days
- Paperclip Gem not loading file from Database on first try
- Rails - How to handle Model Templates
- Gitlab CE not sending email
- Rails search routing friendly URL
- How can I catch the log output of called submethods
- Controller's helper method on factory instance
- Auth0 with Rails API
- Multiple levels has_many through queries on Rails 5
- how to read a file created in rails using javascript within new.html.erb
angular 2 subscription class not found Posted: 23 Nov 2016 07:44 AM PST Very new to action cable and angular 2. I keep receiving this error, Subscription class not found: "MessagesChannel", when running the rails server. I am using ng2-cable to connect to my rails api. I am using angular 2 on cordova Rails MessagesChannel Any help is appreciated! |
String start with # return with backslash in rails console in some case Posted: 23 Nov 2016 07:42 AM PST In console of rails 4.2.7, I have the following test: It seems rails will only put a "\" before the string when there is an @ or $ after #. The problem leads me to this test is that I have a erb file that render a data attribute with an array of json: Then in chrome console, it will give the unexpected result as And when I change xx value from #! or some other string, the result will be ok as an array Does someone know if it is true and why it has such difference? And it there any way to tackle this problem? |
Rails 4 Spree Invoke callback "Undefined method for User xxxxx" Posted: 23 Nov 2016 06:51 AM PST I want to use callbacks to modify the admin product controller to create a listing for each user. Using decorator in spree product model I added the "belongs_to :user" relation. In my custom user model I added the "has_many :products" relation and also added product_id and index product_id to my user data table. I have this: object_name is a function inherited from ResourceController. It returns a string containing current object name "product". But it is not working. I am getting "undefined method objects for User XXXXX" Looks like my association is not working. What am I doing wrong? Thanks in advance. |
Javascript browser console error 404 (Not Found) Posted: 23 Nov 2016 07:27 AM PST I have my javascript created in the directory :
In my Haml index.html.haml file, I've included this code to reference my js.file:
and also in config / application.rb I've included :
However when my browser reloads, i get a red line error in the console showing
Why is it getting from javascripts/products.js instead of going through the product directory file which i've put my script in there ? In the script if I have the code alert, it gets triggered but if the codes are jquery, it won't run. |
Create marker on mapbox with rails Posted: 23 Nov 2016 07:02 AM PST I want to create a dynamic map using Ruby on Rails, geojson, gem rgeo-geojson, and mapbox.js. I have a form where users input a country with a select generated by a JSON file listing all the countries. I want Rails to compare it with a Here is my application_helper.rb where I create the select option form : using countries.json file, and now I want to generate a marker on the map (mapbox) depending on which country user choose My countries.json file is like that : |
Posted: 23 Nov 2016 06:43 AM PST I am following this guide, to install ruby, while everything has no problem except when I try to run this command rails new myapp -d mysql in which I got this error Is there any way to solve this? |
Ruby on Rails with React getting NoMethodError Posted: 23 Nov 2016 06:55 AM PST The following is my controller Projects#show method. The following is my Projects#show view html.erb file. The following is my react front-end The error message I get is:
ANY HELP WOULD BE GREATLY APPRECIATED!!! |
How to update a web page from requests made by another client (in rails)? Posted: 23 Nov 2016 06:38 AM PST Here is my need: I have to displays some information from a web page. Since HTTP protocol is actually a request/response protocol, I know that to get this functionality, the connection between the server and the client (which is local here) should be kept open in some way (Websocket, Server-Sent Events, etc..) Yes, "realtime" is really a fashion trend nowadays and there are many frameworks out there to do this (meteor, etc...) And indeed, it seems that Rails supports this functionnality too in addition to using Websockets (Server-Sent Events in Rails 4 and ActionCable in Rails 5) Nevertheless what I really want is to trigger an update of the webpage (displayed here locally) from a request made by another client.. This picture will explain that better :
Ok, here is my question (BTW thank you for reading me thus far). I see 2 differents ways to do this :
Which mechanisms should I use in either method to achieve this functionnality ? But which of these two methods (or another one) is actually the best way to do that? Again thank you for reading me thus far, and sorry for my bad english. |
How do I set up the Elasticsearch indices for this Rails 3.2 project I've inherited? Posted: 23 Nov 2016 06:29 AM PST I've just started working with a Rails 3.2 codebase which uses Elasticsearch via the elasticsearch-rails and elasticsearch-model gems. I've had a lot of difficulty getting this set up. My understanding is that running, for example, I can copy the index structure from production manually, but I'm sure there must be a programmatic way to do it. I'll probably take more time scripting it than doing it myself, but I want to make this project easier to set up for future developers. Am I missing an automatic way to import the indices themselves? Do I have to write such a script myself? Thanks, Alexander |
Tracking with google analytics sign up page in Rails with Devise Posted: 23 Nov 2016 07:11 AM PST I am trying to track each page of my Rails application, rendering this partial on the layout: After adding the Google Analytics ID to the settings, I can see in my Google Analytics dashboard the visits to my With 'UA-XXXXXXXX-X' = Settings.env.app.analytics_id which is defined in config/settings/app.yml under analytics_id. We use devise to handle the signin/signup proccess and this is the part related to devise in the routes.rb |
Rails 4: How do I delete a nested object? Posted: 23 Nov 2016 06:39 AM PST So I have a user model and a nested model "Entries" like that: user.rb entry.rb user/show.html.erb routes.rb entries_controller.rb And I get this error: Couldn't find Entry without an ID on this line What am I doing wrong? |
How can I Iterate through items and generate drag and drop buttons for each one? Posted: 23 Nov 2016 06:07 AM PST I'm very new to coding and I am experimenting with tools that are available. I am aware that my code is probably totally wrong but gave a guess as close as I could. I am trying to iterate through items in the database and for each one I want a button to be created. The button should then be draggable by the user and saved in that position. Does anyone know a way in which I could achieve this? This is as far as I could get with my guess but it does not work. Also, I do not know how to save what the user does. |
Ruby on rails select tags from fixed lists(rails) Posted: 23 Nov 2016 06:17 AM PST I have some models, for example, Post, User. Is it possible to use tags only from fixed lists of tags for model Post and model User? |
How to reverse an irreversible migration Posted: 23 Nov 2016 05:19 AM PST I have this in my devise migration, Now I have rollbacked the migration ..I got an error of Now I cannot access the model, even after rake db:migrate. How to make this work again? |
Rails - validation inside decorator Posted: 23 Nov 2016 05:49 AM PST I'm struggling with some kind of issue. I have a rails model (mongoid). My goal is to call validations depends on which decorator I will use. Let's say I've got two decorators: So now when I create/save/update my user object inside RegistraionDecorator I would like to perform all validation methods. But when I will do it inside PasswordDecorator I want to call for example only password_presence method. When I move validations to decorator it won't work cuz its different class than my model. How can I achieve that? |
Unable to load Bootstrap.min file Posted: 23 Nov 2016 05:11 AM PST I am trying to load bootstrap in my rails application. But it is not working. I had included the I have also tried using Thanks in advance. |
Ruby Active Record accessor dot(.) vs bracket([]) Posted: 23 Nov 2016 05:11 AM PST With Active Record, we can access a value like method access or hash access I just wonder when to use which, or is there any best practice out there? Personally I'd prefer |
ignore Rack::Timeout middle in specific rails routes Posted: 23 Nov 2016 04:47 AM PST I have installed rack-timeout gem and created rack_timeout.rb inside the initializers.I have set Rack::Timeout.service_timeout = 1 inside rack_timeout.rb.I want to restrict the rack-timeout to halt the execution if timeout exceeded in controllers other than controllers inside api.Only the api controllers' execution should be stopped.I have created a custom middleware inside lib named my_middleware.rb config/development.rb but its not working.everywhere rack timeout is throwing the exception when timeout happened. |
How to achieve sequential processing in Rails? Posted: 23 Nov 2016 07:42 AM PST I have a task which has to be performed in sequential manner. It's mosty a database writing. The problem is that I have hard time to achieve it in Rails 5. I'm implementing it in an But this causes deadlock. Let assume: one thread is inside critical section and other wait at critical section entry. So the first thread block on database query. It wait on the query forever. I suppose there iss problem with I've tried the same with locking on file: And I got the same strange behavior. I've tried the same in Controller instead of Do you guys know a way to perform a task in sequential manner in Rails app? A proper way to create critical section? Maybe there is |
Posted: 23 Nov 2016 04:21 AM PST I am using the Froala Editor to upload images to the Amazon S3 server using the imageUplaodToS3 option. I've seen a lot of posts that seem very similar to my post and I still can't figure out why I'm still having issues after reading them so I hope it doesnt get counted as an answered question. I feel like im very close but i get the following error in my console: It worked before but i'm not sure what i changed to make it not work again :( My Amazon S3 CORS configuration is the following: Let me know if there's any other information I can help supply, Thanks in advance! |
How to get data which falls on specific days Posted: 23 Nov 2016 04:20 AM PST Hi I've start_date column which capture time stamp, I'd like to query the data based on days like if date falls on sunday or monday like that. For example Here I need get all the records from tuesday 23:00 pm to sunday 02:00 am. |
Paperclip Gem not loading file from Database on first try Posted: 23 Nov 2016 05:01 AM PST I have a website that allows a user to upload a file to a database using Paperclip gem. When on the dashboard I can click the download url, however when I click the link to open them it will occasionally redirect me to a 404 page saying the page could not be found, when I return to dashboard and try to display the file again it will then load and display in my browser, this sometimes needs to be repeated several times before the file will load. Question: how can I wait for the file to load before sending the response back to the page? |
Rails - How to handle Model Templates Posted: 23 Nov 2016 04:04 AM PST Assume you have a relation of invoices and workpackages. An invoice can consist of more than one workpackage. The tricky thing is that you can modify workpackages after adding to an invoice. That means that you have default workpackages you can select from (templates) and "real" workpackages that are assigned to an invoice. How to handle this scenario in rails? I currently have two ideas:
Downside of my first idea is that I have two tables that are almost identical, only the invoice_id is missing for the templates. Everytime you update one model you have to update both model, view, controllers. Downside of the second idea is that templates and real packages are not completely separate, but do they have to be separate? I would go with option 2 and the template flag, what's your opinion? Is there a best practice on how to deal with templates? To be clear, I am sure that I can handle the problem, I not asking for a workaround or a somehow working solution, I am asking for the best practice if possible or experiences from other developers or maybe things I do not cover yet. |
Posted: 23 Nov 2016 04:00 AM PST I have setup Gitlab CE on a local Ubuntu Server, and I'm trying to use Zoho to send email to users. But, mails are not sent. Even when testing with My SMTP config is as follow : And Reply by email config : Can somebody help me fix this ? Update : This is the output of the test in
|
Rails search routing friendly URL Posted: 23 Nov 2016 03:34 AM PST I have found one example on this forum below link: http://stackoverflow.com/a/14232632/4172515 This not enough for me, I have two input field form I have no idea how to do this. |
How can I catch the log output of called submethods Posted: 23 Nov 2016 03:23 AM PST I am trying to debug a rake task (from an old Redmine v2 instance). I made this task (source) and I run this task: This does indeed give me some logging (in this case I get "Receiving message 106; Message 106 can not be processed"), but apparently only of the main rake task However, the log outputs of the called methods (like this one) are not shown. Is there any trick to also catch the log outputs of called methods? |
Controller's helper method on factory instance Posted: 23 Nov 2016 07:01 AM PST I have helper method "current_cart" in application controller: In line_item factory I try assign a value current cart to cart_id: Error: What is the right way to use "current_cart" method in line_item factory? |
Posted: 23 Nov 2016 04:03 AM PST I don't have a specific technical issue but a general problem understanding the architecture for using Auth0 for Authentication and then using the returned profile to access a rails API. I am using Auth0.Lock in React Native and can successfully sign-up and login to my React Native App and store the returned profile and token. On the Rails side I have create an API and setup Knock (https://github.com/nsarno/knock) as per the instructions to implement JWT Authentication. What I don't understand is the link between my User model in Rails and my Database in Auth0. Neither the Auth0 documentation or the Knock documentation are clear on how this association happens. Thanks Craig |
Multiple levels has_many through queries on Rails 5 Posted: 23 Nov 2016 03:41 AM PST First of all I have these 4 models: Program: Fields: FieldsProgram: Entity: The issue here is that I'm trying to create a new scope for a search filter. I need to find entities based on their fields and I'm a little bit confused since there is two 'has_many through' relationships to get there. How can I achieve that ? Do I need to use Arel? This is what I'm working on for now but obviously it doesn't work Thanks in advance for your answers |
how to read a file created in rails using javascript within new.html.erb Posted: 23 Nov 2016 03:15 AM PST I have this method in rails where i am creating external events.json file. now events.json file is created in my app directory. In my new.html.erb, how to access this file via javascript and set it to a variable? I tried this.. and i get this error message when i inspect, |
You are subscribed to email updates from Newest questions tagged ruby-on-rails - Stack Overflow. To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
Google Inc., 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States |
No comments:
Post a Comment