Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
how would you do to be able to change messages without having to stop the play instance?
You can't do that if your messages files are declared in common destination (and probably they are).
If you want to make it easier you need to put some additional work, for an example, you can use JavaScript for translating the labels, next you need to put these files OUTSIDE the public folder of the app, somewhere in the filesystem and access it with additional http server (otherwise it will require redeploying the app after each change).
off-topic:
In general I'm big advocate of serving static, public assets with frontend HTTP server instead of using the assets.at... method, thanks to this approach you are able to add/change/delete these assets without redeploying the application, and as we know images/scripts/styles are very often the subject to change. Finally you don't waste Play's resources for serving that stuff, and you are able to write advanced caching rulez with server's config (instead of 'fighting' with proper headers in Play's controllers)
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Is there some library or tool to allow a rails application to be configured using external files?
I want the database configuration (by default in config/database.yml) and the application configuration (configured in a environment specific file in config/environments/*.rb) to be in files (preferably yaml) not included in the project.
I know that this is not the standard way of doing things, but has some benefits:
The files can live in separate repository in version control
You can have different access control to this repository (you can hide the production configuration)
The config files can be deployed separately
You can change them manually on the machine, and they won't be overwritten when the application is re-deployed
You don't have to have a different rails environment for each deployment environment, but can have the changes made on that specific machine.
You could share configurations between applications
An even better solution would be to have partial external configuration - this way you can still have your basic configuration in the application, but overwrite parts of it.
It's is possible to do if you copy the external config files inside the application. This can be done in the beginning of config/application.rb before rails is loaded, but it looks like a hack, and hard to maintain. Is there some practical solution to allow this?
Dotenv is excellent and does exactly what you want. It's very common and a great way to keep secrets out of shared files. Combine it with env_bang-rails for some added goodness (defaults, failures if undefined, etc.)
https://github.com/bkeepers/dotenv
https://github.com/jcamenisch/ENV_BANG/
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Improve this question
So i created my first app which allows users to track there fitness information (workouts, routines, etc). I want take my app to the next step by allowing the user to create there own account and be able to access their workouts from any ios device (all they have to do is log in). I know i have to use databases, but I just don't know where or how to start this process.
Could you recommend any tutorials or perhaps a resource you used to teach yourself? I'm familiar with sql (took a course on it in university.
thanks guys, I apologize for the newb question.
There are many third-party services you can use that can take care of the backend for your app so that you don't need to worry about managing the database yourself. Two of the most popular ones are parse and stackmob. Take a look at their documentations. I personally use parse and would recommend it.
I've never written any os apps, but for applications in general.
There are many ways, one of which is getting a server/website (you can get free ones) and set up the MYSQL database to have the tables you need like users etc.
Then simply send requests via POST/GET to the server which will enter it into the database.Then when they want to login just do the reverse.
I would personally uses sockets, and probably encrypt the data. You may as-well send information such as how long they've used the app for etc.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I created a library kit! with common tools.
I created a library box! with cool features that uses kit!.
Now I want to create a client app that uses box!.
Do I have to link both libraries?
Or will box! link kit!?
Hope the question makes sense. I use a workflow, where I include the library projects as well (to be able to edit libraries as well trough the development process), add them as target dependencies, import headers right from the project source directory.
For static libraries, it's generally best to link kit and box to the client app -- directly.
If kit were a private dependency of box (i.e. private sub-library), then it makes sense to link kit with box so that clients don't have to manage private dependencies. You can also do that where you know there will always be a to-one dependency. So yes, you can add kit as a dependency to box and link kit to box. Then the client app can just link to box.
What you want to avoid with to-many dependencies is huge recursive builds, huge object files, symbol cloning/duplication, and not knowing which definitions you will end up with. Although they won't eliminate that problem, they will reduce it.
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 8 years ago.
Improve this question
When we create new objects and variables in controller/view, where are they stored; at the client side in the browser, or at the server side?
I currently have information stored in objects and variables in both controller and views that I don't really want to be accessible by any user, for example, the authentication token etc.
The variables and objects themselves are stored on the server.
Remember that your web site is an application like any other, and variables and objects in code exist in that code only. You can choose to output their values in your views if you want to, but, if you choose not to, there is no way for the user to get at them.
Variables and objects are in memory on the serving host ONLY if you don't write them to disk or a database or a mem-cache for persistence or data-sharing.
Whether those other stores can be accessed/hacked is a different question and not suitable for Stack Overflow.
Sometimes, on big clustered/load-balanced systems, we HAVE to write session data, shopping carts, cookies, etc., to some sort of shared-storage because we can't say for sure which host is going to receive the user's connection and all servers have to be able to pick up where another left off. Security is always an issue, but in those systems it becomes much harder because there are a lot more moving parts. But, for a small, single-host server, you should be fine.
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I've been trying to do some research for whether or not I should include file extensions in my url paths in my website (and whether or not it is detrimental to use relative urls).
Among some of the sites I have visited for this research are listed below:
http://css-tricks.com/snippets/htaccess/remove-file-extention-from-urls/
http://www.seo-theory.com/2011/11/30/how-do-pretty-urls-help-search-engine-optimization/
However, none of them have really answered my questions.
As for whether or not to include file extensions:
Assuming that all of the links are NOT broken, and I have constructed them properly, are there any downfalls to linking to other pages within my site and including the file extension? Originally, I thought I should include them just for specificity's sake, but now I know it doesn't make as pretty of a url.
Does this effect SEO greatly?
Should I go back and erase all .cshtml, .jpg, etc. from my url paths? Should I include this removal from the tags that link to my .js and .css external files?
If it matters, the context of this question is coming from a C#.net WebMatrix environment.
You can erase the .cshtml part of your urls if you like (I generally do) but you should not erase the extensions of images, style sheets, JavaScript files etc. The .cshtml files will be found by the Web Pages framework through its rudimentary routing system, but that only applies to .cshtml and .vbhtml files. If you remove the extensions from other types of file, they will not be found. And in any event, it would be pointless. It's not as if you want Google to index your .css file (which it doesn't).
As to whether removing the .cshtml extension will affect SEO - no, it will make no difference. If it did, you would easily be able to find a lot of advice to that effect.