Search Results

Search found 37316 results on 1493 pages for 'model view controller'.

Page 17/1493 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • WEBrick::HTTPStatus::LengthRequired error when accessing create method in controller

    - by Chris Bisignani
    I have a very simple controller set up: class LibrariesController < ApplicationController ... def create @user.libraries << Library.new(params) @user.save render :json => "success!" end ... end Basically, whenever I try to access the create method of LibrariesController using HTTParty.post I get a WEBrick::HTTPStatus::LengthRequired error on the server. The method is not even being accessed! Here is the stack trace (this is the full output server side - notice that the controller isn't even being accessed): [2010-04-16 00:35:39] ERROR WEBrick::HTTPStatus::LengthRequired [2010-04-16 00:35:39] ERROR HTTPRequest#fixup: WEBrick::HTTPStatus::LengthRequired occured. [2010-04-16 00:35:39] ERROR NoMethodError: private method `gsub!' called for #<Class:0x2362160> /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/htmlutils.rb:17:in `escape' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/httpresponse.rb:232:in `set_error' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/httpserver.rb:70:in `run' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:162:in `start' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:95:in `start' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/gems/1.8/gems/rack-1.0.1/lib/rack/handler/webrick.rb:14:in `run' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:111 /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' /usr/local/Cellar/ruby_187/1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' script/server:3 I'm running rails 2.3.5 and ruby 1.8.7. Any help would be greatly appreciated. Let me know if you need more details.

    Read the article

  • refresh table view iphone

    - by Florent
    Hi all !! So i've set a table view, i have set a system which set if the row have been already selected, i set checkmarck acessory for a row which have been seen, i write the row in a plist to an int value. It work good but only when i restart the app or reload the table view in my navigation controller. I mean when i select a row it pushes a view controller, then when i go back to the table view checkmark disappear and we do not know if the row have already been selected only when the app restart. So is there a way to refresh the table view ? ? in the view will appear for example ? ? thanks to all !!!!

    Read the article

  • Unit testing a controller method?

    - by Stefan Kendall
    I have a controller method like such: def search = { def query = params.query ... render results as JSON } How do I unit test this? Specifically, how do I call search to set params.query, and how do I test the results of the method render? Is there a way to mock the render method, perhaps?

    Read the article

  • Redirecting to another controller in Rails

    - by Vitaly
    Hi, I'm trying to redirect from one controller to another in Rails and I am getting this error: undefined method `call' for nil:NilClass The code is pretty simple (in def create method): @blog_post_comment = BlogPostComment.new(params[:blog_post_comment]) respond_to do |format| if @blog_post_comment.save flash[:notice] = 'Comment was successfully created.' redirect_to(@blog_post_comment.blog_post) else render :action => "new" end end Save goes ok, the value gets into the database. How can I work around the redirect fail?

    Read the article

  • Add a background image to tables in a navigation view in a tabbed application

    - by padatronic
    Hi people, I have a tabbed application which then has a navigation controller. In each the navigation controller I an a table View Controller which obviously contains a table. I push a new table view controller from this one. I want to put a background to the table but can only add an image infront of the table. I think this may be because I am adding the sub view in the table view controller, but I don't seem to be able to add it anywhere else. Please could you help me, thanks.

    Read the article

  • Passing direct parameters to a Controller#method when testing via RSpec

    - by gmile
    Normally to pass parameters via in RSpec we do: params[:my_key] = my_value get :my_method Where my_method deals with what it received from params. But in my controller I have a method, which takes args directly i.e.: def my_method(*args) ... end How do I call the method with those args from within the test? I've tried get :my_method(args) but Ruby interpreter complains about syntax error.

    Read the article

  • How to use Eclipse's Display View for Debug?

    - by jzd
    At the link below it explains that the "display view allows you to manipulate live code in a scrapbook type fashion (see Figure 8). To manipulate a variable, simply type the name of the variable in the Display view, and you'll be greeted with a familiar content assist." http://www.ibm.com/developerworks/library/os-ecbug/ However, I am having trouble getting it to work. I have the view open but all the buttons are disabled. I have tried putting code in the view, selecting code in the view, selecting code in other views, while running and while not running debug, but the only button that is ever enabled on the view is "clear console". Suggestions on what I am doing wrong?

    Read the article

  • Status messages on the Spring MVC-based site (annotation controller)

    - by linpulee
    What is the best way to organize status messages on the Spring MVC-based site? I mean messages which, for example, returns when user has sent What is the best way to organize status messages ("Your data has been successfully saved/added/deleted") on the Spring MVC-based site using annotation controller? So, the issue is in the way of sending the message from POST-method in contoller.

    Read the article

  • Saving data from another model (my own log system)

    - by user331321
    Hi! I´m trying to write a log system for my CakePHP intranet. What i need is to store de username/datetime whene someone tryes to login. My login code is on the clients_controller and i need to store the data on a model called log (i have the model, controller, view... but they are not related) how can i achive that? thank you

    Read the article

  • how to apply the center of image view for another image view center

    - by maddy
    hi, I am developing image redraw app. i know the center of one image view which is having scaling property. i.e it can change it frame and center . that to be applied to another view center. when i apply center to newly formed Image view it giving wrong center because of the previous image view is having scaling property. so how can i get exact center to my new image view from previous imageview

    Read the article

  • Selection on table view causes parent view to change

    - by Tereno
    Hi there, I'm working on an iPad app and here's my scenario: I have a view which contains a table view inside of it. When the user selects an item on the table view, I would like the parent's view to change in a navigational manner. For those of you that have an iPad, this would be akin to the "Settings" app. But I guess in the "Settings" app, the right pane is composed of a grouped table view right? Is what I'm trying to do possible? Thanks

    Read the article

  • Inserting code to HTML view from a pop up initiated from visual view

    - by objectiveME
    I am trying to insert html into the HTML view.What i have done is to have tinymce advanced(a wordpress plugin) button that throws a popup and in it is all the necessary things to insert the html.The tinymce buttons are however only visible on the visual view. Question 1: Is it a plugin or hack that can allow one to parse html inside the visual view Question 2: Is it possible to insert html code to the html view from a popup initiated from the visual view

    Read the article

  • MVC 4 Controller Compilation Error trying to return a Model

    - by Joe
    This is a newbie configuration problem I suspect. See return statement comment in code snippet. [HttpGet] public ActionResult TestService() { ViewBag.Message = "DataLayer Service"; Service dataLayerService = new Service {CookieContainer = new CookieContainer()}; dataLayerService.SetSessionAppName("SAND"); WebServiceModel webServiceModel = new WebServiceModel(); webServiceModel.Result = dataLayerService.GetSessionAppName(); return this.View(webServiceModel); // <== Cannot resolve View "TestService" }

    Read the article

  • How to deal with data on the model specific to the technology being used?

    - by user1620696
    There are some cases where some of the data on a class of the domain model of an application seems to be dependent on the technology being used. One example of this is the following: suppose we are building one application in .NET such that there's the need of an Employee class. Suppose further that we are going to implement relational database, then the Employee has a primary key right? So that the classe would be something like public class Employee { public int EmployeeID { get; set; } public string Name { get; set; } ... } Now, that EmployeeID is dependent on the technology right? That's something that has to do with the way we've choose to persist our data. Should we write down a class independent of such things? If we do it this way, how should we work? I think I would need to map all the time between domain model and persistence specific types, but I'm not sure.

    Read the article

  • Developing a Cost Model for Cloud Applications

    - by BuckWoody
    Note - please pay attention to the date of this post. As much as I attempt to make the information below accurate, the nature of distributed computing means that components, units and pricing will change over time. The definitive costs for Microsoft Windows Azure and SQL Azure are located here, and are more accurate than anything you will see in this post: http://www.microsoft.com/windowsazure/offers/  When writing software that is run on a Platform-as-a-Service (PaaS) offering like Windows Azure / SQL Azure, one of the questions you must answer is how much the system will cost. I will not discuss the comparisons between on-premise costs (which are nigh impossible to calculate accurately) versus cloud costs, but instead focus on creating a general model for estimating costs for a given application. You should be aware that there are (at this writing) two billing mechanisms for Windows and SQL Azure: “Pay-as-you-go” or consumption, and “Subscription” or commitment. Conceptually, you can consider the former a pay-as-you-go cell phone plan, where you pay by the unit used (at a slightly higher rate) and the latter as a standard cell phone plan where you commit to a contract and thus pay lower rates. In this post I’ll stick with the pay-as-you-go mechanism for simplicity, which should be the maximum cost you would pay. From there you may be able to get a lower cost if you use the other mechanism. In any case, the model you create should hold. Developing a good cost model is essential. As a developer or architect, you’ll most certainly be asked how much something will cost, and you need to have a reliable way to estimate that. Businesses and Organizations have been used to paying for servers, software licenses, and other infrastructure as an up-front cost, and power, people to the systems and so on as an ongoing (and sometimes not factored) cost. When presented with a new paradigm like distributed computing, they may not understand the true cost/value proposition, and that’s where the architect and developer can guide the conversation to make a choice based on features of the application versus the true costs. The two big buckets of use-types for these applications are customer-based and steady-state. In the customer-based use type, each successful use of the program results in a sale or income for your organization. Perhaps you’ve written an application that provides the spot-price of foo, and your customer pays for the use of that application. In that case, once you’ve estimated your cost for a successful traversal of the application, you can build that into the price you charge the user. It’s a standard restaurant model, where the price of the meal is determined by the cost of making it, plus any profit you can make. In the second use-type, the application will be used by a more-or-less constant number of processes or users and no direct revenue is attached to the system. A typical example is a customer-tracking system used by the employees within your company. In this case, the cost model is often created “in reverse” - meaning that you pilot the application, monitor the use (and costs) and that cost is held steady. This is where the comparison with an on-premise system becomes necessary, even though it is more difficult to estimate those on-premise true costs. For instance, do you know exactly how much cost the air conditioning is because you have a team of system administrators? This may sound trivial, but that, along with the insurance for the building, the wiring, and every other part of the system is in fact a cost to the business. There are three primary methods that I’ve been successful with in estimating the cost. None are perfect, all are demand-driven. The general process is to lay out a matrix of: components units cost per unit and then multiply that times the usage of the system, based on which components you use in the program. That sounds a bit simplistic, but using those metrics in a calculation becomes more detailed. In all of the methods that follow, you need to know your application. The components for a PaaS include computing instances, storage, transactions, bandwidth and in the case of SQL Azure, database size. In most cases, architects start with the first model and progress through the other methods to gain accuracy. Simple Estimation The simplest way to calculate costs is to architect the application (even UML or on-paper, no coding involved) and then estimate which of the components you’ll use, and how much of each will be used. Microsoft provides two tools to do this - one is a simple slider-application located here: http://www.microsoft.com/windowsazure/pricing-calculator/  The other is a tool you download to create an “Return on Investment” (ROI) spreadsheet, which has the advantage of leading you through various questions to estimate what you plan to use, located here: https://roianalyst.alinean.com/msft/AutoLogin.do?d=176318219048082115  You can also just create a spreadsheet yourself with a structure like this: Program Element Azure Component Unit of Measure Cost Per Unit Estimated Use of Component Total Cost Per Component Cumulative Cost               Of course, the consideration with this model is that it is difficult to predict a system that is not running or hasn’t even been developed. Which brings us to the next model type. Measure and Project A more accurate model is to actually write the code for the application, using the Software Development Kit (SDK) which can run entirely disconnected from Azure. The code should be instrumented to estimate the use of the application components, logging to a local file on the development system. A series of unit and integration tests should be run, which will create load on the test system. You can use standard development concepts to track this usage, and even use Windows Performance Monitor counters. The best place to start with this method is to use the Windows Azure Diagnostics subsystem in your code, which you can read more about here: http://blogs.msdn.com/b/sumitm/archive/2009/11/18/introducing-windows-azure-diagnostics.aspx This set of API’s greatly simplifies tracking the application, and in fact you can use this information for more than just a cost model. After you have the tracking logs, you can plug the numbers into ay of the tools above, which should give a representative cost or in some cases a unit cost. The consideration with this model is that the SDK fabric is not a one-to-one comparison with performance on the actual Windows Azure fabric. Those differences are usually smaller, but they do need to be considered. Also, you may not be able to accurately predict the load on the system, which might lead to an architectural change, which changes the model. This leads us to the next, most accurate method for a cost model. Sample and Estimate Using standard statistical and other predictive math, once the application is deployed you will get a bill each month from Microsoft for your Azure usage. The bill is quite detailed, and you can export the data from it to do analysis, and using methods like regression and so on project out into the future what the costs will be. I normally advise that the architect also extrapolate a unit cost from those metrics as well. This is the information that should be reported back to the executives that pay the bills: the past cost, future projected costs, and unit cost “per click” or “per transaction”, as your case warrants. The challenge here is in the model itself - statistical methods are not foolproof, and the larger the sample (in this case I recommend the entire population, not a smaller sample) is key. References and Tools Articles: http://blogs.msdn.com/b/patrick_butler_monterde/archive/2010/02/10/windows-azure-billing-overview.aspx http://technet.microsoft.com/en-us/magazine/gg213848.aspx http://blog.codingoutloud.com/2011/06/05/azure-faq-how-much-will-it-cost-me-to-run-my-application-on-windows-azure/ http://blogs.msdn.com/b/johnalioto/archive/2010/08/25/10054193.aspx http://geekswithblogs.net/iupdateable/archive/2010/02/08/qampa-how-can-i-calculate-the-tco-and-roi-when.aspx   Other Tools: http://cloud-assessment.com/ http://communities.quest.com/community/cloud_tools

    Read the article

  • CastClassException on Custom View

    - by tuxGurl
    When I try to findViewById() on my custom view I keep getting a ClassCastException. I've tried so many things that I'm sure I've botched the code now! To make sure I'm not going insane I stripped down the classes to their bare minimum inorder to find what was wrong. I'm new to android programming and I'm sure I'm missing something basic. This is BaseImageView an extended view class. package com.company.product.client.android.gui.views; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.view.View; public class BaseImageView extends View { public BaseImageView(Context context) { super(context); } @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawColor(Color.GREEN); } } This is LiveImageView an extension of the BaseImageView class. package com.company.product.client.android.gui.views; import android.content.Context; import android.util.AttributeSet; public class LiveImageView extends BaseImageView { public LiveImageView(Context context, AttributeSet attrs) { super(context); } } Here is the Layout my_view.xml. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center"> <View class="com.company.product.client.android.gui.views.LiveImageView" android:id="@+id/lvImage" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> And here is the onCreate in my Activity LiveViewActivity. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); try { setContentView(R.layout.my_view); final LiveImageView lvImage = (LiveImageView) findViewById(R.id.lvImage); } catch (final Exception e) { Log.e(TAG, "onCreate() Exception: " + e.toString()); e.printStackTrace(); } Finally, this is stack trace. 02-11 17:25:24.829: ERROR/LiveViewActivity(1942): onCreate() Exception: java.lang.ClassCastException: android.view.View 02-11 17:25:24.839: WARN/System.err(1942): java.lang.ClassCastException: android.view.View 02-11 17:25:24.839: WARN/System.err(1942): at com.company.product.client.android.gui.screen.LiveViewActivity.onCreate(LiveViewActivity.java:26) 02-11 17:25:24.839: WARN/System.err(1942): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread.access$2200(ActivityThread.java:119) 02-11 17:25:24.849: WARN/System.err(1942): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863) 02-11 17:25:24.859: WARN/System.err(1942): at android.os.Handler.dispatchMessage(Handler.java:99) 02-11 17:25:24.859: WARN/System.err(1942): at android.os.Looper.loop(Looper.java:123) 02-11 17:25:24.859: WARN/System.err(1942): at android.app.ActivityThread.main(ActivityThread.java:4363) 02-11 17:25:24.869: WARN/System.err(1942): at java.lang.reflect.Method.invokeNative(Native Method) 02-11 17:25:24.869: WARN/System.err(1942): at java.lang.reflect.Method.invoke(Method.java:521) 02-11 17:25:24.869: WARN/System.err(1942): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860) 02-11 17:25:24.869: WARN/System.err(1942): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618) 02-11 17:25:24.879: WARN/System.err(1942): at dalvik.system.NativeStart.main(Native Method)

    Read the article

  • Aggregate SharePoint Event/Items into your Calendar view using Calendar Overlay

    - by eJugnoo
    One of the most common features I have seen in common use for SharePoint (prior to 2010) in Intranet environments for Team site is Calendar’s. Not only the Calendar list type, but also the ability to add a Calendar view to any list that has the desired columns to construct a Calendar – such as Start, End, Title etc. While this was all great for a single site/calendar, the problem of having to track numerous calendar’s remained. With introduction of Outlook 2007 bi-directional integration with SharePoint, and particularly the ability of Outlook to overlay calendar helped bridge the gap. Now one could connect to number of team sites, and setup Calendar overlays in Outlook using varying colours, to easily identify event source and yet benefit from the plotting of events on single Calendar view. This was all good, but each user in your Enterprise was supposed to setup in a “pull” fashion. This is good for flexibility, not so good when you need to “push” consistency and productivity (re-use). So, what was missing on SharePoint is the ability to have server-side overlay’s that everyone can see – in a single place, aggregating multiple sources. Until SharePoint 2010 arrived! Calendars Overlay in SharePoint 2010 There are Calendar lists and Calendar views. View can be created for almost all lists, as far as you have desired column’s in a list like Start, End, Title etc. to be able to describe and plot an item in a Calendar format. In SharePoint 2010, create a new Calendar list. Go to Calendar ribbon tab, and click Calendar Overlay. You get the screen with list of existing Overlay’s associated with current Calendar (list – in our case). Click on “New Calendar”… Notice the breadcrumb! You are adding Overlay to existing list (Team Calendar – in our case). You have choice of “pulling” Calendar info from an existing Calendar (list/view) in SharePoint or even from Exchange! Set standard info like a name, description and decide the colour you want for the items in aggregated Calendar overlay. Select the source site/list/view, anywhere in farm. When you select Exchange as source of Calendar, you get option to add OWA and Exchange Web Service url. I will cover details of connecting with Exchange in another post, and focus on Overlay’s with SharePoint for this one. Once you have added a new Calendar overlay to existing Calendar veiw, you get something like below for Day view, Week view, and Month view respectively Notice the Overlay colours: Now, if you decide to connect this Calendar to Outlook to sync the items, it will only sync items from main view, and not from Overlay source. So such Overlay of calendar’s is server-side aggregation only. That increases my curiosity, so I try adding the Calendar list view as a web-part on a new page. As you see, this instance of view didn’t include item from source that we had added to default Calendar view. This is – probably – due to the fact that this is a new web-part view for the page. If you want to add overlay to this one, you have to redo that from Ribbon. This also means, subject to purpose and context you get the flexibility to decide what overlay is suited. Also you can only add 10 Overlay’s to an existing view instance. Conclusion Calendar Overlay is clearly a very useful feature that fills a gap of not being able to aggregate information from multiple sources into a Calendar view within context of current items. Source of items can be existing SharePoint calendar views on any site, or even Exchange (via OWA/Exchange web services). List type for source doesn’t matter, it just need a Calendar view type available. You can have 10 overlays. Overlays are for the specific view only, and are server-side only – which means they do not get synced in Outlook. While you can drag-drop current list items, you cannot edit overlay items as they are read-only within scope of current Calendar view. You can of course click on source Overlay item to edit at the source. I’d like to hear, how you think Overlay’s will help you in your case, or how you are already using them... Enjoy SharePoint! --Sharad

    Read the article

  • Reduced Tree View in NetBeans IDE 7.2

    - by Geertjan
    Right-click within the Projects window in NetBeans IDE 7.2 and from the "View Java Packages As" menu, you can now choose "Reduced Tree".I never really understood the difference between "Reduced Tree" and the already existing "Tree". But it makes sense when you see it. Here's Reduced Tree view: And here's Tree view, where you can see that the "actions" and "nodes" packages above each have their own top level package nodes, which takes up more space than the above: What's cool is that your selected package view is persisted across restarts of the IDE. To be complete, here's the List view, which is the third option you have in the "View Java Packages As" menu: Seems to me like the new Reduced Tree view combines the best of the Tree view with the best of the List view! Related issue: http://netbeans.org/bugzilla/show_bug.cgi?id=53192

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >